diff options
-rw-r--r-- | build.nix | 18 | ||||
-rw-r--r-- | default.nix | 17 | ||||
-rw-r--r-- | grim/default.nix | 7 | ||||
-rw-r--r-- | grim/metadata.nix | 4 | ||||
-rw-r--r-- | nixpkgs/default.nix | 7 | ||||
-rw-r--r-- | nixpkgs/metadata.nix | 4 | ||||
-rw-r--r-- | redshift-wayland/575.patch | 51 | ||||
-rw-r--r-- | redshift-wayland/default.nix | 87 | ||||
-rw-r--r-- | slurp/metadata.nix | 4 | ||||
-rw-r--r-- | sway-beta/metadata.nix | 4 | ||||
-rwxr-xr-x | update.sh | 35 | ||||
-rw-r--r-- | wlroots/default.nix | 18 | ||||
-rw-r--r-- | wlroots/metadata.nix | 4 | ||||
-rw-r--r-- | wlstream/0001-meson-add-libdrm-dependency.patch | 37 | ||||
-rw-r--r-- | wlstream/default.nix | 36 | ||||
-rw-r--r-- | wlstream/metadata.nix | 4 |
16 files changed, 292 insertions, 45 deletions
diff --git a/build.nix b/build.nix new file mode 100644 index 0000000..133995a --- /dev/null +++ b/build.nix @@ -0,0 +1,18 @@ +let + # import nixos-unstable + # this is for visibility so you can see what versions of nixpkgs are prebuilt + + #nixpkgs = (import ./nixpkgs); # TODO: remove this when nixos-unstable advances and has `sway-beta` + + nixpkgs = + if builtins.pathExists /etc/nixpkgs + then /etc/nixpkgs + else (import ./nixpkgs); + + pkgs = import nixpkgs { + overlays = [ (import ./default.nix) ]; + }; + +in + with pkgs; [ swaypkgs ] + diff --git a/default.nix b/default.nix index 90b1d53..13d7d7d 100644 --- a/default.nix +++ b/default.nix @@ -1,15 +1,22 @@ self: super: let -in -{ wlroots = super.callPackage ./wlroots { inherit self super; }; sway-beta = super.callPackage ./sway-beta { inherit self super; }; - grim = super.callPackage ./grim {}; slurp = super.callPackage ./slurp {}; + wlstream = super.callPackage ./wlstream {}; waybar = super.callPackage ./waybar {}; - #wlstream = super.callPackage ./wlstream {}; redshift-wayland = super.callPackage ./redshift-wayland {}; -} + swaypkgs = { + inherit wlroots; + inherit sway-beta; + inherit grim; + inherit slurp; + inherit wlstream; + #inherit waybar; + #inherit redshift-wayland; + }; +in + swaypkgs // { inherit swaypkgs; } diff --git a/grim/default.nix b/grim/default.nix index 6b3210f..9c4bc8a 100644 --- a/grim/default.nix +++ b/grim/default.nix @@ -4,15 +4,18 @@ , scdoc, buildDocs ? true }: +let + metadata = import ./metadata.nix; +in stdenv.mkDerivation rec { name = "grim-${version}"; - version = "97202f22003200edcc3fb5966ddc9b19cfe1c6f9"; + version = "${metadata.rev}"; src = fetchFromGitHub { owner = "emersion"; repo = "grim"; rev = version; - sha256 = "1cq8v4wiqjzg0p84f7l04ydbpirbplfm8zwmg2j2f28qcl5igylp"; + sha256 = "${metadata.sha256}"; }; nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs [ scdoc ]; diff --git a/grim/metadata.nix b/grim/metadata.nix index d8867b6..8a38bb0 100644 --- a/grim/metadata.nix +++ b/grim/metadata.nix @@ -1,4 +1,4 @@ { - rev: "97202f22003200edcc3fb5966ddc9b19cfe1c6f9"; - sha256: "1cq8v4wiqjzg0p84f7l04ydbpirbplfm8zwmg2j2f28qcl5igylp"; + rev = "97202f22003200edcc3fb5966ddc9b19cfe1c6f9"; + sha256 = "1cq8v4wiqjzg0p84f7l04ydbpirbplfm8zwmg2j2f28qcl5igylp"; } diff --git a/nixpkgs/default.nix b/nixpkgs/default.nix new file mode 100644 index 0000000..1d43220 --- /dev/null +++ b/nixpkgs/default.nix @@ -0,0 +1,7 @@ +let + meta = import ./metadata.nix; +in + builtins.fetchTarball { + url = "https://github.com/nixos/nixpkgs-channels/archive/${meta.rev}.tar.gz"; + sha256 = meta.sha256; + } diff --git a/nixpkgs/metadata.nix b/nixpkgs/metadata.nix new file mode 100644 index 0000000..60195e2 --- /dev/null +++ b/nixpkgs/metadata.nix @@ -0,0 +1,4 @@ +{ + rev = "45a419ab5a23c93421c18f3d9cde015ded22e712"; + sha256 = "00mpq5p351xsk0p682xjggw17qgd079i45yj0aa6awawpckfx37s"; +} diff --git a/redshift-wayland/575.patch b/redshift-wayland/575.patch new file mode 100644 index 0000000..d731d8e --- /dev/null +++ b/redshift-wayland/575.patch @@ -0,0 +1,51 @@ +From 467156efccc5e36a36bec8c0b64cc5a70f14d5ed Mon Sep 17 00:00:00 2001 +From: Yegor Timoshenko <yegortimoshenko@riseup.net> +Date: Tue, 16 Jan 2018 11:43:46 +0000 +Subject: [PATCH] Fix Autoconf script + +gettext/intltool macros are not used correctly, see: +https://bugs.launchpad.net/inkscape/+bug/1418943 +--- + bootstrap | 6 +----- + configure.ac | 5 +---- + 2 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/bootstrap b/bootstrap +index 0599cf5..40b1dca 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -1,7 +1,3 @@ + #!/bin/sh + +-# change to root directory +-cd $(dirname "$0") +- +-autopoint --force && \ +- AUTOPOINT="intltoolize --automake --copy" autoreconf --force --install --verbose ++autoreconf --force --install && intltoolize +diff --git a/configure.ac b/configure.ac +index be0b51a..a2e7c42 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -17,6 +17,7 @@ AC_PROG_OBJC # For macOS support modules + AC_LANG([C]) + + AC_PROG_INTLTOOL([0.50]) ++AC_SUBST(LIBINTL) + + AC_CANONICAL_HOST + +@@ -51,10 +52,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ + ]) + AC_LANG_POP([Objective C]) + +-# Checks for libraries. +-AM_GNU_GETTEXT_VERSION([0.17]) +-AM_GNU_GETTEXT([external]) +- + GETTEXT_PACKAGE=redshift + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) +-- +2.15.1 + diff --git a/redshift-wayland/default.nix b/redshift-wayland/default.nix new file mode 100644 index 0000000..27e9016 --- /dev/null +++ b/redshift-wayland/default.nix @@ -0,0 +1,87 @@ +{ stdenv, fetchFromGitHub, autoconf, automake, gettext, intltool +, libtool, pkgconfig, wrapGAppsHook, wrapPython, gobjectIntrospection +, gtk3, python, pygobject3, hicolor-icon-theme, pyxdg + +, withRandr ? stdenv.isLinux, libxcb +, withDrm ? stdenv.isLinux, libdrm +, withWayland ? stdenv.isLinux, wayland, wayland-protocols, wlroots +, withGeoclue ? stdenv.isLinux, geoclue }: + +stdenv.mkDerivation rec { + name = "redshift-${version}"; + version = "a2177ed9942477868ccc514372f32a0fbcbe189e"; + + src = fetchFromGitHub { + owner = "minus7"; + repo = "redshift"; + rev = "${version}"; + sha256 = "1ka8gjjddkjvcxnnyk9y9rqj1askjcf6ikajyh7a7wfj6z5j9c2j"; + }; + + patches = [ + # https://github.com/jonls/redshift/pull/575 + ./575.patch + ]; + + nativeBuildInputs = [ + autoconf + automake + gettext + intltool + libtool + pkgconfig + wrapGAppsHook + wrapPython + ]; + + configureFlags = [ + "--enable-randr=${if withRandr then "yes" else "no"}" + "--enable-geoclue2=${if withGeoclue then "yes" else "no"}" + "--enable-drm=${if withDrm then "yes" else "no"}" + "--enable-wayland=${if withWayland then "yes" else "no"}" + ]; + + buildInputs = [ + gobjectIntrospection + gtk3 + python + hicolor-icon-theme + ] ++ stdenv.lib.optional withRandr libxcb + ++ stdenv.lib.optional withGeoclue geoclue + ++ stdenv.lib.optional withDrm libdrm + ++ stdenv.lib.optional withWayland [ wayland wayland-protocols wlroots ] + ; + + pythonPath = [ pygobject3 pyxdg ]; + + preConfigure = "./bootstrap"; + + postFixup = "wrapPythonPrograms"; + + # the geoclue agent may inspect these paths and expect them to be + # valid without having the correct $PATH set + postInstall = '' + substituteInPlace $out/share/applications/redshift.desktop \ + --replace 'Exec=redshift' "Exec=$out/bin/redshift" + substituteInPlace $out/share/applications/redshift.desktop \ + --replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk" + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "Screen color temperature manager"; + longDescription = '' + Redshift adjusts the color temperature according to the position + of the sun. A different color temperature is set during night and + daytime. During twilight and early morning, the color temperature + transitions smoothly from night to daytime temperature to allow + your eyes to slowly adapt. At night the color temperature should + be set to match the lamps in your room. + ''; + license = licenses.gpl3Plus; + homepage = http://jonls.dk/redshift; + platforms = platforms.linux; + maintainers = with maintainers; [ yegortimoshenko ]; + }; +} diff --git a/slurp/metadata.nix b/slurp/metadata.nix index 6c6563f..17db476 100644 --- a/slurp/metadata.nix +++ b/slurp/metadata.nix @@ -1,4 +1,4 @@ { - rev: "d907d308eb1eebf9b1be4a047edbc8f163bdd4b7"; - sha256: "07aa3pwqm2a1cf60sipnzrdk1d7m0193jz22s15wqzxh93v3013l"; + rev = "d907d308eb1eebf9b1be4a047edbc8f163bdd4b7"; + sha256 = "07aa3pwqm2a1cf60sipnzrdk1d7m0193jz22s15wqzxh93v3013l"; } diff --git a/sway-beta/metadata.nix b/sway-beta/metadata.nix index 86e96a0..8589743 100644 --- a/sway-beta/metadata.nix +++ b/sway-beta/metadata.nix @@ -1,4 +1,4 @@ { - rev: "bdb176863c3c45caae70abb909f9eca9f611e78f"; - sha256: "0ngc1c9q24ajzpcyidbh91cv9zqjlim816n76rj1dbw3r81r5qv7"; + rev = "bdb176863c3c45caae70abb909f9eca9f611e78f"; + sha256 = "0ngc1c9q24ajzpcyidbh91cv9zqjlim816n76rj1dbw3r81r5qv7"; } @@ -2,13 +2,6 @@ set -euo pipefail set -x -# TODO: update this for the overlay repo -# make it spit out <pkg_name>/metadata.nix with -# { -# url = "${rev}"; -# sha256 = "${sha256}"; -# } - ## ## use github api to get latest commit for a repo ## use nix-prefetch-url to get the hash @@ -18,29 +11,31 @@ set -x export nixpkgs=/etc/nixpkgs-sway export NIX_PATH=nixpkgs=${nixpkgs} -# update: <derivation-name> <github-repo-owner> <github-repo-name> +# update: <derivation-name> <github-repo-owner> <github-repo-name> <ref> function update() { attr="${1}" owner="${2}" repo="${3}" - rev="$(curl --silent --fail "https://api.github.com/repos/${owner}/${repo}/commits" | jq -r ".[0].sha")" + ref="${4}" + rev="$(curl --silent --fail "https://api.github.com/repos/${owner}/${repo}/commits?sha=${ref}" | jq -r ".[0].sha")" sha256="$(nix-prefetch-url --unpack "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz" 2>/dev/null)" - #pushd "${nixpkgs}" >/dev/null - #echo "Updating attribute '${attr}'." - #"${nixpkgs}/pkgs/common-updater/scripts/update-source-version" "${attr}" "${rev}" "${sha256}" - #popd >/dev/null + mkdir -p "./${attr}" cat<<EOF >"./${attr}/metadata.nix" { - rev: "${rev}"; - sha256: "${sha256}"; + rev = "${rev}"; + sha256 = "${sha256}"; } EOF } -update "wlroots" "swaywm" "wlroots" -update "sway-beta" "swaywm" "sway" -update "slurp" "emersion" "slurp" -update "grim" "emersion" "grim" -update "wlstream" "atomnuker" "wlstream" +# attr_name repo_owner repo_name repo_rev +update "wlroots" "swaywm" "wlroots" "master" +update "sway-beta" "swaywm" "sway" "master" +update "slurp" "emersion" "slurp" "master" +update "grim" "emersion" "grim" "master" +update "wlstream" "atomnuker" "wlstream" "master" +update "nixpkgs" "nixos" "nixpkgs-channels" "nixos-unstable" + +nix-build build.nix diff --git a/wlroots/default.nix b/wlroots/default.nix index 22febdb..98e16cc 100644 --- a/wlroots/default.nix +++ b/wlroots/default.nix @@ -1,17 +1,19 @@ { self, super, pkgs, fetchFromGitHub }: let - version = "c55d1542fe30ea7872a60a732fa88028cd4d4b06"; - sha256 = "0xfipgg2qh2xcf3a1pzx8pyh1aqpb9rijdyi0as4s6fhgy4w2666"; + meta = import ./metadata.nix; in - super.wlroots.override { - name = "wlroots-${version}"; - version = version; + super.wlroots.overrideAttrs (old: rec { + name = "wlroots-${meta.rev}"; + version = meta.rev; src = fetchFromGitHub { owner = "swaywm"; repo = "wlroots"; - rev = version; - sha256 = sha256; + rev = meta.rev; + sha256 = meta.sha256; }; - } + # TODO(maintenance): this needs to be updated as upstream changes + # remove patches, we don't need to fix the wlroots version anymore + patches = []; + }) diff --git a/wlroots/metadata.nix b/wlroots/metadata.nix index 8ca13cf..3ffbdfc 100644 --- a/wlroots/metadata.nix +++ b/wlroots/metadata.nix @@ -1,4 +1,4 @@ { - rev: "c55d1542fe30ea7872a60a732fa88028cd4d4b06"; - sha256: "0spvlq51h6smw9p8wxl1ii82mpgily6ch7hm7glx31djdpk5wzk7"; + rev = "c55d1542fe30ea7872a60a732fa88028cd4d4b06"; + sha256 = "0spvlq51h6smw9p8wxl1ii82mpgily6ch7hm7glx31djdpk5wzk7"; } diff --git a/wlstream/0001-meson-add-libdrm-dependency.patch b/wlstream/0001-meson-add-libdrm-dependency.patch new file mode 100644 index 0000000..4f077b3 --- /dev/null +++ b/wlstream/0001-meson-add-libdrm-dependency.patch @@ -0,0 +1,37 @@ +From 8bd19591b9a415ad8bdaef42684602a91e06cc97 Mon Sep 17 00:00:00 2001 +From: Cole Mickens <cole.mickens@gmail.com> +Date: Sun, 21 Oct 2018 23:08:16 -0700 +Subject: [PATCH] meson: add libdrm dependency + +--- + meson.build | 1 + + src/meson.build | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/meson.build b/meson.build +index 6ea40b0..5491a26 100644 +--- a/meson.build ++++ b/meson.build +@@ -14,6 +14,7 @@ wayland_client = dependency('wayland-client') + wayland_protocols = dependency('wayland-protocols', version: '>=1.14') + + #Library deps ++libdrm = dependency('libdrm') + libavutil = dependency('libavutil') + libavcodec = dependency('libavcodec') + libavformat = dependency('libavformat') +diff --git a/src/meson.build b/src/meson.build +index e943fe5..a59a838 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -4,6 +4,7 @@ executable( + install: true, + dependencies: [wayland_client, + wlstream_protos, ++ libdrm, + libavutil, + libavcodec, + libpulse, +-- +2.16.2 + diff --git a/wlstream/default.nix b/wlstream/default.nix new file mode 100644 index 0000000..3e16682 --- /dev/null +++ b/wlstream/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub +, meson, ninja, pkgconfig +, libdrm, wayland, wayland-protocols +, ffmpeg_4, libpulseaudio +}: + +stdenv.mkDerivation rec { + name = "wlstream-${version}"; + version = "182076a94562b128c3a97ecc53cc68905ea86838"; + + src = fetchFromGitHub { + owner = "atomnuker"; + repo = "wlstream"; + rev = version; + sha256 = "01qbcgfl3g9kfwn1jf1z9pdj3bvf5lmg71d1vwkcllc2az24bjqp"; + }; + + patches = [ ./0001-meson-add-libdrm-dependency.patch ]; + enableParallelBuilding = true; + nativeBuildInputs = [ meson ninja pkgconfig ]; + buildInputs = [ + libdrm wayland wayland-protocols + ffmpeg_4 libpulseaudio + ]; + mesonFlags = [ + "-Dauto_features=enabled" + ]; + + meta = with stdenv.lib; { + description = "wlroots-compatible screen capture application"; + homepage = "https://github.com/atomnuker/wlstream"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ colemickens ]; + }; +} diff --git a/wlstream/metadata.nix b/wlstream/metadata.nix index 7954465..2ad1844 100644 --- a/wlstream/metadata.nix +++ b/wlstream/metadata.nix @@ -1,4 +1,4 @@ { - rev: "182076a94562b128c3a97ecc53cc68905ea86838"; - sha256: "01qbcgfl3g9kfwn1jf1z9pdj3bvf5lmg71d1vwkcllc2az24bjqp"; + rev = "182076a94562b128c3a97ecc53cc68905ea86838"; + sha256 = "01qbcgfl3g9kfwn1jf1z9pdj3bvf5lmg71d1vwkcllc2az24bjqp"; } |