From 51e0ef8568a9b07bde43ec0e477435215d2ddca9 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 10 May 2024 18:17:52 -0300 Subject: [PATCH 1/6] arcan: move sources to sources.nix It is easier to control them this way, in order to not pollute the master package file. Also, let's put them on passthru. --- pkgs/by-name/ar/arcan/package.nix | 201 +++++++++++++----------------- pkgs/by-name/ar/arcan/sources.nix | 65 ++++++++++ 2 files changed, 150 insertions(+), 116 deletions(-) create mode 100644 pkgs/by-name/ar/arcan/sources.nix diff --git a/pkgs/by-name/ar/arcan/package.nix b/pkgs/by-name/ar/arcan/package.nix index ce4fc7256b77..e7c7180b8d8d 100644 --- a/pkgs/by-name/ar/arcan/package.nix +++ b/pkgs/by-name/ar/arcan/package.nix @@ -1,106 +1,69 @@ -{ lib -, stdenv -, fetchFromGitHub -, SDL2 -, callPackage -, cmake -, espeak-ng -, ffmpeg -, file -, freetype -, glib -, gumbo -, harfbuzz -, jbig2dec -, leptonica -, libGL -, libX11 -, libXau -, libXcomposite -, libXdmcp -, libXfixes -, libdrm -, libffi -, libjpeg -, libusb1 -, libuvc -, libvlc -, libvncserver -, libxcb -, libxkbcommon -, makeWrapper -, mesa -, mupdf -, openal -, openjpeg -, pcre2 -, pkg-config -, ruby -, sqlite -, tesseract -, valgrind -, wayland -, wayland-protocols -, xcbutil -, xcbutilwm -, xz -, buildManPages ? true -, useBuiltinLua ? true -, useEspeak ? !stdenv.isDarwin -, useStaticLibuvc ? true -, useStaticOpenAL ? true -, useStaticSqlite ? true -, useTracy ? true +{ + lib, + SDL2, + callPackage, + cmake, + espeak-ng, + ffmpeg, + file, + freetype, + glib, + gumbo, + harfbuzz, + jbig2dec, + leptonica, + libGL, + libX11, + libXau, + libXcomposite, + libXdmcp, + libXfixes, + libdrm, + libffi, + libjpeg, + libusb1, + libuvc, + libvlc, + libvncserver, + libxcb, + libxkbcommon, + makeWrapper, + mesa, + mupdf, + openal, + openjpeg, + pcre2, + pkg-config, + ruby, + sqlite, + stdenv, + tesseract, + valgrind, + wayland, + wayland-protocols, + xcbutil, + xcbutilwm, + xz, + # Boolean flags + buildManPages ? true, + useBuiltinLua ? true, + useEspeak ? !stdenv.isDarwin, + useStaticLibuvc ? true, + useStaticOpenAL ? true, + useStaticSqlite ? true, + useTracy ? true, + # Configurable options + sources ? callPackage ./sources.nix { }, }: -let - allSources = { - letoram-arcan = { - pname = "arcan"; - version = "0.6.2.1-unstable-2023-11-18"; - src = fetchFromGitHub { - owner = "letoram"; - repo = "arcan"; - rev = "0950ee236f96a555729498d0fdf91c16901037f5"; - hash = "sha256-TxadRlidy4KRaQ4HunPO6ISJqm6JwnMRM8y6dX6vqJ4="; - }; - }; - letoram-openal-src = fetchFromGitHub { - owner = "letoram"; - repo = "openal"; - rev = "81e1b364339b6aa2b183f39fc16c55eb5857e97a"; - hash = "sha256-X3C3TDZPiOhdZdpApC4h4KeBiWFMxkFsmE3gQ1Rz420="; - }; - libuvc-src = fetchFromGitHub { - owner = "libuvc"; - repo = "libuvc"; - rev = "68d07a00e11d1944e27b7295ee69673239c00b4b"; - hash = "sha256-IdV18mnPTDBODpS1BXl4ulkFyf1PU2ZmuVGNOIdQwzE="; - }; - luajit-src = fetchFromGitHub { - owner = "LuaJIT"; - repo = "LuaJIT"; - rev = "656ecbcf8f669feb94e0d0ec4b4f59190bcd2e48"; - hash = "sha256-/gGQzHgYuWGqGjgpEl18Rbh3Sx2VP+zLlx4N9/hbYLc="; - }; - tracy-src = fetchFromGitHub { - owner = "wolfpld"; - repo = "tracy"; - rev = "93537dff336e0796b01262e8271e4d63bf39f195"; - hash = "sha256-FNB2zTbwk8hMNmhofz9GMts7dvH9phBRVIdgVjRcyQM="; - }; - }; -in stdenv.mkDerivation (finalAttrs: { - inherit (allSources.letoram-arcan) pname version src; + inherit (sources.letoram-arcan) pname version src; nativeBuildInputs = [ cmake makeWrapper pkg-config - ] ++ lib.optionals buildManPages [ - ruby - ]; + ] ++ lib.optionals buildManPages [ ruby ]; buildInputs = [ SDL2 @@ -140,28 +103,31 @@ stdenv.mkDerivation (finalAttrs: { xcbutil xcbutilwm xz - ] - ++ lib.optionals useEspeak [ - espeak-ng - ]; + ] ++ lib.optionals useEspeak [ espeak-ng ]; # Emulate external/git/clone.sh - postUnpack = let - inherit (allSources) - letoram-openal-src libuvc-src luajit-src tracy-src; - prepareSource = flag: source: destination: - lib.optionalString flag '' - cp -va ${source}/ ${destination} - chmod --recursive 744 ${destination} - ''; - in + postUnpack = + let + inherit (sources) + letoram-openal + libuvc + luajit + tracy + ; + prepareSource = + flag: source: destination: + lib.optionalString flag '' + cp -va ${source}/ ${destination} + chmod --recursive 744 ${destination} + ''; + in '' pushd $sourceRoot/external/git/ '' - + prepareSource useStaticOpenAL letoram-openal-src "openal" - + prepareSource useStaticLibuvc libuvc-src "libuvc" - + prepareSource useBuiltinLua luajit-src "luajit" - + prepareSource useTracy tracy-src "tracy" + + prepareSource useStaticOpenAL letoram-openal.src "openal" + + prepareSource useStaticLibuvc libuvc.src "libuvc" + + prepareSource useBuiltinLua luajit.src "luajit" + + prepareSource useTracy tracy.src "tracy" + '' popd ''; @@ -195,11 +161,10 @@ stdenv.mkDerivation (finalAttrs: { "../src" ]; - hardeningDisable = [ - "format" - ]; + hardeningDisable = [ "format" ]; passthru = { + inherit sources; wrapper = callPackage ./wrapper.nix { }; }; @@ -212,7 +177,11 @@ stdenv.mkDerivation (finalAttrs: { e.g. game development, real-time streaming video, monitoring and surveillance, up to and including desktop compositors and window managers. ''; - license = with lib.licenses; [ bsd3 gpl2Plus lgpl2Plus ]; + license = with lib.licenses; [ + bsd3 + gpl2Plus + lgpl2Plus + ]; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.unix; }; diff --git a/pkgs/by-name/ar/arcan/sources.nix b/pkgs/by-name/ar/arcan/sources.nix new file mode 100644 index 000000000000..6759935d3507 --- /dev/null +++ b/pkgs/by-name/ar/arcan/sources.nix @@ -0,0 +1,65 @@ +{ + fetchFromGitHub, +}: + +{ + letoram-arcan = { + pname = "arcan"; + version = "0.6.2.1-unstable-2023-11-18"; + + src = fetchFromGitHub { + owner = "letoram"; + repo = "arcan"; + rev = "0950ee236f96a555729498d0fdf91c16901037f5"; + hash = "sha256-TxadRlidy4KRaQ4HunPO6ISJqm6JwnMRM8y6dX6vqJ4="; + }; + }; + + letoram-openal = { + pname = "letoram-openal"; + version = "0.6.2"; + + src = fetchFromGitHub { + owner = "letoram"; + repo = "openal"; + rev = "81e1b364339b6aa2b183f39fc16c55eb5857e97a"; + hash = "sha256-X3C3TDZPiOhdZdpApC4h4KeBiWFMxkFsmE3gQ1Rz420="; + }; + }; + + libuvc = { + pname = "libuvc"; + version = "0.0.7"; + + src = fetchFromGitHub { + owner = "libuvc"; + repo = "libuvc"; + rev = "68d07a00e11d1944e27b7295ee69673239c00b4b"; + hash = "sha256-IdV18mnPTDBODpS1BXl4ulkFyf1PU2ZmuVGNOIdQwzE="; + }; + }; + + luajit = { + pname = "luajit"; + version = "2.1-unstable-2023-10-08"; + + src = fetchFromGitHub { + owner = "LuaJIT"; + repo = "LuaJIT"; + rev = "656ecbcf8f669feb94e0d0ec4b4f59190bcd2e48"; + hash = "sha256-/gGQzHgYuWGqGjgpEl18Rbh3Sx2VP+zLlx4N9/hbYLc="; + }; + }; + + tracy = { + pname = "tracy"; + version = "0.9.1-unstable-2023-10-09"; + + src = fetchFromGitHub { + owner = "wolfpld"; + repo = "tracy"; + rev = "93537dff336e0796b01262e8271e4d63bf39f195"; + hash = "sha256-FNB2zTbwk8hMNmhofz9GMts7dvH9phBRVIdgVjRcyQM="; + }; + }; +} From dda2d7672ee3168fc13514485213ae1bde30e7d0 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 28 Jun 2024 15:12:33 -0300 Subject: [PATCH 2/6] arcan: refactor - hammer-reorder - replace-fail - strictDeps - split outputs --- pkgs/by-name/ar/arcan/package.nix | 40 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/ar/arcan/package.nix b/pkgs/by-name/ar/arcan/package.nix index e7c7180b8d8d..d3eeec5c5838 100644 --- a/pkgs/by-name/ar/arcan/package.nix +++ b/pkgs/by-name/ar/arcan/package.nix @@ -105,6 +105,25 @@ stdenv.mkDerivation (finalAttrs: { xz ] ++ lib.optionals useEspeak [ espeak-ng ]; + cmakeFlags = [ + # The upstream project recommends tagging the distribution + (lib.cmakeFeature "DISTR_TAG" "Nixpkgs") + (lib.cmakeFeature "ENGINE_BUILDTAG" finalAttrs.src.rev) + (lib.cmakeFeature "BUILD_PRESET" "everything") + (lib.cmakeBool "BUILTIN_LUA" useBuiltinLua) + (lib.cmakeBool "DISABLE_JIT" useBuiltinLua) + (lib.cmakeBool "STATIC_LIBUVC" useStaticLibuvc) + (lib.cmakeBool "STATIC_SQLite3" useStaticSqlite) + (lib.cmakeBool "ENABLE_TRACY" useTracy) + "../src" + ]; + + outputs = [ "out" "dev" "lib" "man" ]; + + hardeningDisable = [ "format" ]; + + strictDeps = true; + # Emulate external/git/clone.sh postUnpack = let @@ -134,10 +153,10 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' substituteInPlace ./src/platform/posix/paths.c \ - --replace "/usr/bin" "$out/bin" \ - --replace "/usr/share" "$out/share" + --replace-fail "/usr/bin" "$out/bin" \ + --replace-fail "/usr/share" "$out/share" substituteInPlace ./src/CMakeLists.txt \ - --replace "SETUID" "# SETUID" + --replace-fail "SETUID" "# SETUID" ''; # INFO: Arcan build scripts require the manpages to be generated *before* the @@ -148,21 +167,6 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - cmakeFlags = [ - # The upstream project recommends tagging the distribution - (lib.cmakeFeature "DISTR_TAG" "Nixpkgs") - (lib.cmakeFeature "ENGINE_BUILDTAG" finalAttrs.src.rev) - (lib.cmakeFeature "BUILD_PRESET" "everything") - (lib.cmakeBool "BUILTIN_LUA" useBuiltinLua) - (lib.cmakeBool "DISABLE_JIT" useBuiltinLua) - (lib.cmakeBool "STATIC_LIBUVC" useStaticLibuvc) - (lib.cmakeBool "STATIC_SQLite3" useStaticSqlite) - (lib.cmakeBool "ENABLE_TRACY" useTracy) - "../src" - ]; - - hardeningDisable = [ "format" ]; - passthru = { inherit sources; wrapper = callPackage ./wrapper.nix { }; From 6a6ce2296446f4939b5ad1d25c38cedfa9370b04 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 2 Jun 2024 16:31:24 -0300 Subject: [PATCH 3/6] arcan: 0.6.2.1-unstable-2023-11-18 -> 0.6.3 Also update the external/git sources too. --- pkgs/by-name/ar/arcan/sources.nix | 39 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/ar/arcan/sources.nix b/pkgs/by-name/ar/arcan/sources.nix index 6759935d3507..da25792c04e8 100644 --- a/pkgs/by-name/ar/arcan/sources.nix +++ b/pkgs/by-name/ar/arcan/sources.nix @@ -3,17 +3,20 @@ }: { - letoram-arcan = { - pname = "arcan"; - version = "0.6.2.1-unstable-2023-11-18"; + letoram-arcan = let + self = { + pname = "arcan"; + version = "0.6.3"; - src = fetchFromGitHub { - owner = "letoram"; - repo = "arcan"; - rev = "0950ee236f96a555729498d0fdf91c16901037f5"; - hash = "sha256-TxadRlidy4KRaQ4HunPO6ISJqm6JwnMRM8y6dX6vqJ4="; + src = fetchFromGitHub { + owner = "letoram"; + repo = "arcan"; + rev = self.version; + hash = "sha256-ZSKOkNrFa2QgmXmmXnLkB1pehmVJbEFVeNs43Z2DSKo="; + }; }; - }; + in + self; letoram-openal = { pname = "letoram-openal"; @@ -29,37 +32,37 @@ libuvc = { pname = "libuvc"; - version = "0.0.7"; + version = "0.0.7-unstable-2024-03-05"; src = fetchFromGitHub { owner = "libuvc"; repo = "libuvc"; - rev = "68d07a00e11d1944e27b7295ee69673239c00b4b"; - hash = "sha256-IdV18mnPTDBODpS1BXl4ulkFyf1PU2ZmuVGNOIdQwzE="; + rev = "047920bcdfb1dac42424c90de5cc77dfc9fba04d"; + hash = "sha256-Ds4N9ezdO44eBszushQVvK0SUVDwxGkUty386VGqbT0="; }; }; luajit = { pname = "luajit"; - version = "2.1-unstable-2023-10-08"; + version = "2.1-unstable-2024-04-19"; src = fetchFromGitHub { owner = "LuaJIT"; repo = "LuaJIT"; - rev = "656ecbcf8f669feb94e0d0ec4b4f59190bcd2e48"; - hash = "sha256-/gGQzHgYuWGqGjgpEl18Rbh3Sx2VP+zLlx4N9/hbYLc="; + rev = "9b5e837ac2dfdc0638830c048a47ca9378c504d3"; + hash = "sha256-GflF/sELSNanc9G4WMzoOadUBOFSs6OwqhAXa4sudWA="; }; }; tracy = { pname = "tracy"; - version = "0.9.1-unstable-2023-10-09"; + version = "0.10-unstable-2024-05-08"; src = fetchFromGitHub { owner = "wolfpld"; repo = "tracy"; - rev = "93537dff336e0796b01262e8271e4d63bf39f195"; - hash = "sha256-FNB2zTbwk8hMNmhofz9GMts7dvH9phBRVIdgVjRcyQM="; + rev = "11eee619fbb2ca97d8b7f7f6e0d6b20e37afbe61"; + hash = "sha256-VRRNL7trX9Q6x/ujByidlJQvHxtDe7NZ7JomLFzXDE0="; }; }; } From ed12d8f5e0d6e88570ae8a024c19bc7f77fceb16 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 2 Jun 2024 21:21:10 -0300 Subject: [PATCH 4/6] arcan: declare upstream tracy alongside letoram fork The fork is somewhat broken. --- pkgs/by-name/ar/arcan/sources.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ar/arcan/sources.nix b/pkgs/by-name/ar/arcan/sources.nix index da25792c04e8..6701021eb6b4 100644 --- a/pkgs/by-name/ar/arcan/sources.nix +++ b/pkgs/by-name/ar/arcan/sources.nix @@ -56,13 +56,25 @@ tracy = { pname = "tracy"; - version = "0.10-unstable-2024-05-08"; + version = "0.9.1-unstable-2023-10-09"; src = fetchFromGitHub { owner = "wolfpld"; repo = "tracy"; - rev = "11eee619fbb2ca97d8b7f7f6e0d6b20e37afbe61"; - hash = "sha256-VRRNL7trX9Q6x/ujByidlJQvHxtDe7NZ7JomLFzXDE0="; + rev = "93537dff336e0796b01262e8271e4d63bf39f195"; + hash = "sha256-FNB2zTbwk8hMNmhofz9GMts7dvH9phBRVIdgVjRcyQM="; + }; + }; + + letoram-tracy = { + pname = "letoram-tracy"; + version = "0-unstable-2024-04-12"; + + src = fetchFromGitHub { + owner = "letoram"; + repo = "tracy"; + rev = "5b3513d9838317bfc0e72344b94aa4443943c2fd"; + hash = "sha256-hUdYC4ziQ7V7T7k99MERp81F5mPHzFtPFrqReWsTjOQ="; }; }; } From cf8d0c34cc8f6db19e31b8f591768c51c4471176 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 11 May 2024 09:53:11 -0300 Subject: [PATCH 5/6] durden: unstable-2023-10-23 -> 0-unstable-2024-06-23 --- pkgs/by-name/du/durden/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/du/durden/package.nix b/pkgs/by-name/du/durden/package.nix index 3d72e132964a..96d721a5561e 100644 --- a/pkgs/by-name/du/durden/package.nix +++ b/pkgs/by-name/du/durden/package.nix @@ -1,17 +1,18 @@ -{ lib -, stdenvNoCC -, fetchFromGitHub +{ + lib, + stdenvNoCC, + fetchFromGitHub, }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "durden"; - version = "unstable-2023-10-23"; + version = "0-unstable-2024-06-23"; src = fetchFromGitHub { owner = "letoram"; repo = "durden"; - rev = "347dba6da011bbaa70c6edaf82a2d915f4057db3"; - hash = "sha256-iNf7fOzz7mf1CXG5leCenkSTrdCc9/KL8VLw8gUIyKE="; + rev = "dffb94b69355ffa9cda074c1d0a48af74b78c220"; + hash = "sha256-sBhlBk4vAYwedw4VerUfY80SXbVoEDid54si6qwDeXs="; }; dontConfigure = true; From af2c0c85ed89c5f0940477e3999371e4f6a72749 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 11 May 2024 09:52:34 -0300 Subject: [PATCH 6/6] cat9: unstable-2023-11-06 -> 0-unstable-2024-06-17 --- pkgs/by-name/ca/cat9/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ca/cat9/package.nix b/pkgs/by-name/ca/cat9/package.nix index 8cee41e62f7e..011450c02560 100644 --- a/pkgs/by-name/ca/cat9/package.nix +++ b/pkgs/by-name/ca/cat9/package.nix @@ -1,17 +1,18 @@ -{ lib -, stdenvNoCC -, fetchFromGitHub +{ + lib, + fetchFromGitHub, + stdenvNoCC, }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "cat9"; - version = "unstable-2023-11-06"; + version = "0-unstable-2024-06-17"; src = fetchFromGitHub { owner = "letoram"; repo = "cat9"; - rev = "a807776a85237ab0bdd0a712fb33c176fc295e30"; - hash = "sha256-OlH8FgVBk76Qw+5mnsrryXOL9GbPJWlwUGtYlLuAPxQ="; + rev = "f00e8791c1826065d4a93ace12e55ab5732d17a7"; + hash = "sha256-xFw6r7SQK0T5j7hVK3U39U2Q/qZow6Ad/R0Cl6nqUQw="; }; dontConfigure = true;