From d8f7f6a5cee067b81bfaaa3aa079adb94ed7c01e Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 25 Jul 2023 13:29:10 +0000 Subject: [PATCH] treewide: noop: refer to `src.name` or similar in `sourceRoot` where appropriate, part 2: the non-trivial cases --- .../misc/johnny-reborn/with-data.nix | 40 +++++----- .../version-management/gitqlient/default.nix | 80 ++++++++++--------- pkgs/data/themes/mojave/default.nix | 43 +++++----- .../configuration-tensorflow.nix | 2 +- pkgs/games/endgame-singularity/default.nix | 34 ++++---- pkgs/games/koboredux/default.nix | 53 ++++++------ 6 files changed, 133 insertions(+), 119 deletions(-) diff --git a/pkgs/applications/misc/johnny-reborn/with-data.nix b/pkgs/applications/misc/johnny-reborn/with-data.nix index 1e53edaa5b85..04300524665e 100644 --- a/pkgs/applications/misc/johnny-reborn/with-data.nix +++ b/pkgs/applications/misc/johnny-reborn/with-data.nix @@ -6,34 +6,32 @@ , makeWrapper }: + +let + sounds = fetchFromGitHub { + owner = "nivs1978"; + repo = "Johnny-Castaway-Open-Source"; + rev = "be6afefd43a3334acc66fc9d777c162c8bfb9558"; + hash = "sha256-rtZVCn4KbEBVwaSQ4HZhMoDEI5Q9IPj9SZywgAx0MPY="; + }; + + resources = fetchzip { + name = "scrantic-source"; + url = "https://archive.org/download/johnny-castaway-screensaver/scrantic-run.zip"; + hash = "sha256-Q9chCYReOQEmkTyIkYo+D+OXYUqxPNOOEEmiFh8yaw4="; + stripRoot = false; + }; +in + stdenvNoCC.mkDerivation { pname = "johnny-reborn"; inherit (johnny-reborn-engine) version; - srcs = - let - sounds = fetchFromGitHub { - owner = "nivs1978"; - repo = "Johnny-Castaway-Open-Source"; - rev = "be6afefd43a3334acc66fc9d777c162c8bfb9558"; - hash = "sha256-rtZVCn4KbEBVwaSQ4HZhMoDEI5Q9IPj9SZywgAx0MPY="; - }; - - resources = fetchzip { - name = "scrantic-source"; - url = "https://archive.org/download/johnny-castaway-screensaver/scrantic-run.zip"; - hash = "sha256-Q9chCYReOQEmkTyIkYo+D+OXYUqxPNOOEEmiFh8yaw4="; - stripRoot = false; - }; - in - [ - sounds - resources - ]; + srcs = [ sounds resources ]; nativeBuildInputs = [ makeWrapper ]; - sourceRoot = "source"; + sourceRoot = sounds.name; dontConfigure = true; dontBuild = true; diff --git a/pkgs/applications/version-management/gitqlient/default.nix b/pkgs/applications/version-management/gitqlient/default.nix index a1c4ec5c6949..622c0f045135 100644 --- a/pkgs/applications/version-management/gitqlient/default.nix +++ b/pkgs/applications/version-management/gitqlient/default.nix @@ -6,48 +6,52 @@ , gitUpdater }: -mkDerivation rec { +let pname = "gitqlient"; version = "1.5.0"; - srcs = [ - (fetchFromGitHub { - owner = "francescmm"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-Mq29HbmPABrRIJjWC5AAKIOKbGngeJdkZkWeJw8BFuw="; - }) - (fetchFromGitHub rec { - owner = "francescmm"; - repo = "AuxiliarCustomWidgets"; - rev = "835f538b4a79e4d6bb70eef37a32103e7b2a1fd1"; - sha256 = "sha256-b1gb/7UcLS6lI92dBfTenGXA064t4dZufs3S9lu/lQA="; - name = repo; - }) - (fetchFromGitHub rec { - owner = "francescmm"; - repo = "QLogger"; - rev = "d1ed24e080521a239d5d5e2c2347fe211f0f3e4f"; - sha256 = "sha256-NVlFYmm7IIkf8LhQrAYXil9kH6DFq1XjOEHQiIWmER4="; - name = repo; - }) - (fetchFromGitHub rec { - owner = "francescmm"; - repo = "QPinnableTabWidget"; - rev = "cc937794e910d0452f0c07b4961c6014a7358831"; - sha256 = "sha256-2KzzBv/s2t665axeBxWrn8aCMQQArQLlUBOAlVhU+wE="; - name = repo; - }) - (fetchFromGitHub rec { - owner = "francescmm"; - repo = "git"; - rev = "b62750f4da4b133faff49e6f53950d659b18c948"; - sha256 = "sha256-4FqA+kkHd0TqD6ZuB4CbJ+IhOtQG9uWN+qhSAT0dXGs="; - name = repo; - }) - ]; + main_src = fetchFromGitHub { + owner = "francescmm"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Mq29HbmPABrRIJjWC5AAKIOKbGngeJdkZkWeJw8BFuw="; + }; + aux_src = fetchFromGitHub rec { + owner = "francescmm"; + repo = "AuxiliarCustomWidgets"; + rev = "835f538b4a79e4d6bb70eef37a32103e7b2a1fd1"; + sha256 = "sha256-b1gb/7UcLS6lI92dBfTenGXA064t4dZufs3S9lu/lQA="; + name = repo; + }; + qlogger_src = fetchFromGitHub rec { + owner = "francescmm"; + repo = "QLogger"; + rev = "d1ed24e080521a239d5d5e2c2347fe211f0f3e4f"; + sha256 = "sha256-NVlFYmm7IIkf8LhQrAYXil9kH6DFq1XjOEHQiIWmER4="; + name = repo; + }; + qpinnabletab_src = fetchFromGitHub rec { + owner = "francescmm"; + repo = "QPinnableTabWidget"; + rev = "cc937794e910d0452f0c07b4961c6014a7358831"; + sha256 = "sha256-2KzzBv/s2t665axeBxWrn8aCMQQArQLlUBOAlVhU+wE="; + name = repo; + }; + git_src = fetchFromGitHub rec { + owner = "francescmm"; + repo = "git"; + rev = "b62750f4da4b133faff49e6f53950d659b18c948"; + sha256 = "sha256-4FqA+kkHd0TqD6ZuB4CbJ+IhOtQG9uWN+qhSAT0dXGs="; + name = repo; + }; +in - sourceRoot = "source"; +mkDerivation rec { + inherit pname version; + + srcs = [ main_src aux_src qlogger_src qpinnabletab_src git_src ]; + + sourceRoot = main_src.name; nativeBuildInputs = [ qmake diff --git a/pkgs/data/themes/mojave/default.nix b/pkgs/data/themes/mojave/default.nix index a39790686253..0e4bbdbe5aae 100644 --- a/pkgs/data/themes/mojave/default.nix +++ b/pkgs/data/themes/mojave/default.nix @@ -21,8 +21,27 @@ }: let + pname = "mojave-gtk-theme"; + version = "2023-06-13"; + + main_src = fetchFromGitHub { + owner = "vinceliuice"; + repo = pname; + rev = version; + hash = "sha256-0jb/VQ6Z0BGaEka57BWM0pBweP08cr4jfPRdEN/BJ1M="; + }; + + wallpapers_src = fetchFromGitHub { + owner = "vinceliuice"; + repo = pname; + rev = "0c4ae6ddff7e3fab4959469461c4d4042deb1b2f"; + hash = "sha256-7LSZSsRt6zTVPLWzuBgwRC1q1MHp5pN/pMl3x2wR8Ow="; + name = "wallpapers"; + }; + in + lib.checkListOfEnum "${pname}: button size variants" [ "standard" "small" ] buttonSizeVariants lib.checkListOfEnum "${pname}: button variants" [ "standard" "alt" ] buttonVariants lib.checkListOfEnum "${pname}: color variants" [ "light" "dark" ] colorVariants @@ -30,29 +49,11 @@ lib.checkListOfEnum "${pname}: opacity variants" [ "standard" "solid" ] opacityV lib.checkListOfEnum "${pname}: theme variants" [ "default" "blue" "purple" "pink" "red" "orange" "yellow" "green" "grey" "all" ] themeVariants stdenvNoCC.mkDerivation rec { - inherit pname; - version = "2023-06-13"; + inherit pname version; - srcs = [ - (fetchFromGitHub { - owner = "vinceliuice"; - repo = pname; - rev = version; - hash = "sha256-0jb/VQ6Z0BGaEka57BWM0pBweP08cr4jfPRdEN/BJ1M="; - }) - ] - ++ - lib.optional wallpapers - (fetchFromGitHub { - owner = "vinceliuice"; - repo = pname; - rev = "0c4ae6ddff7e3fab4959469461c4d4042deb1b2f"; - hash = "sha256-7LSZSsRt6zTVPLWzuBgwRC1q1MHp5pN/pMl3x2wR8Ow="; - name = "wallpapers"; - }) - ; + srcs = [ main_src ] ++ lib.optional wallpapers wallpapers_src; - sourceRoot = "source"; + sourceRoot = main_src.name; nativeBuildInputs = [ glib diff --git a/pkgs/development/haskell-modules/configuration-tensorflow.nix b/pkgs/development/haskell-modules/configuration-tensorflow.nix index 3f9dc1643275..634f521e5aa4 100644 --- a/pkgs/development/haskell-modules/configuration-tensorflow.nix +++ b/pkgs/development/haskell-modules/configuration-tensorflow.nix @@ -18,7 +18,7 @@ let setTensorflowSourceRoot = dir: drv: (overrideCabal (drv: { src = tensorflow-haskell; }) drv) - .overrideAttrs (_oldAttrs: {sourceRoot = "source/${dir}";}); + .overrideAttrs (_oldAttrs: { sourceRoot = "${tensorflow-haskell.name}/${dir}"; }); in { tensorflow-proto = doJailbreak (setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto); diff --git a/pkgs/games/endgame-singularity/default.nix b/pkgs/games/endgame-singularity/default.nix index e0cd581af823..ceb3d74816a0 100644 --- a/pkgs/games/endgame-singularity/default.nix +++ b/pkgs/games/endgame-singularity/default.nix @@ -6,24 +6,28 @@ , enableDefaultMusicPack ? true }: -python3.pkgs.buildPythonApplication rec { +let pname = "endgame-singularity"; version = "1.00"; - srcs = [ - (fetchFromGitHub { - owner = "singularity"; - repo = "singularity"; - rev = "v${version}"; - sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl"; - }) - ] ++ lib.optional enableDefaultMusicPack ( - fetchurl { - url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip"; - sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb"; - } - ); - sourceRoot = "source"; + main_src = fetchFromGitHub { + owner = "singularity"; + repo = "singularity"; + rev = "v${version}"; + sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl"; + }; + + music_src = fetchurl { + url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip"; + sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb"; + }; +in + +python3.pkgs.buildPythonApplication rec { + inherit pname version; + + srcs = [ main_src ] ++ lib.optional enableDefaultMusicPack music_src; + sourceRoot = main_src.name; nativeBuildInputs = [ unzip ]; # The music is zipped propagatedBuildInputs = with python3.pkgs; [ pygame numpy polib ]; diff --git a/pkgs/games/koboredux/default.nix b/pkgs/games/koboredux/default.nix index 622dd2de50e3..91981fc85fba 100644 --- a/pkgs/games/koboredux/default.nix +++ b/pkgs/games/koboredux/default.nix @@ -11,36 +11,43 @@ }: with lib; -stdenv.mkDerivation rec { + +let pname = "koboredux"; version = "0.7.5.1"; - src = - [(fetchFromGitHub { - owner = "olofson"; - repo = "koboredux"; - rev = "v${version}"; - sha256 = "09h9r65z8bar2z89s09j6px0gdq355kjf38rmd85xb2aqwnm6xig"; - })] - ++ - (optional useProprietaryAssets (requireFile { - name = "koboredux-${version}-Linux.tar.bz2"; - sha256 = "11bmicx9i11m4c3dp19jsql0zy4rjf5a28x4hd2wl8h3bf8cdgav"; - message = '' - Please purchase the game on https://olofson.itch.io/kobo-redux - and download the Linux build. + main_src = fetchFromGitHub { + owner = "olofson"; + repo = pname; + rev = "v${version}"; + sha256 = "09h9r65z8bar2z89s09j6px0gdq355kjf38rmd85xb2aqwnm6xig"; + }; - Once you have downloaded the file, please use the following command - and re-run the installation: + assets_src = requireFile { + name = "koboredux-${version}-Linux.tar.bz2"; + sha256 = "11bmicx9i11m4c3dp19jsql0zy4rjf5a28x4hd2wl8h3bf8cdgav"; + message = '' + Please purchase the game on https://olofson.itch.io/kobo-redux + and download the Linux build. - nix-prefetch-url file://\$PWD/koboredux-${version}-Linux.tar.bz2 + Once you have downloaded the file, please use the following command + and re-run the installation: - Alternatively, install the "koboredux-free" package, which replaces the - proprietary assets with a placeholder theme. - ''; - })); + nix-prefetch-url file://\$PWD/koboredux-${version}-Linux.tar.bz2 - sourceRoot = "source"; # needed when we have the assets source + Alternatively, install the "koboredux-free" package, which replaces the + proprietary assets with a placeholder theme. + ''; + }; + +in + +stdenv.mkDerivation rec { + inherit pname version; + + src = [ main_src ] ++ optional useProprietaryAssets assets_src; + + sourceRoot = main_src.name; # Fix clang build patches = [(fetchpatch {