Skip to content

Commit

Permalink
treewide: expose pname and version in some more packages (#361250)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopejoe1 authored Dec 4, 2024
2 parents c40884e + 83ae8e7 commit 34ac189
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
3 changes: 2 additions & 1 deletion pkgs/applications/misc/zathura/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
],
}:
symlinkJoin {
name = "zathura-with-plugins-${zathura_core.version}";
inherit (zathura_core) version;
pname = "zathura-with-plugins";

paths =
with zathura_core;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/by-name/ge/gepetto-viewer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ let
plugins:
runCommand "gepetto-gui"
{
inherit (finalAttrs) version;
pname = "gepetto-gui";
meta = {
# can't just "inherit (gepetto-viewer) meta;" because:
# error: derivation '/nix/store/…-gepetto-gui.drv' does not have wanted outputs 'bin'
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/x1/x16/run.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ let
};
in
symlinkJoin {
name = "run-x16-${emulator.version}";
pname = "run-x16";
inherit (emulator) version;

paths = [
emulator
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/xm/xmoji/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}:

stdenv.mkDerivation (finalAttrs: {
name = "xmoji";
pname = "xmoji";
version = "0.8";

src = fetchFromGitHub {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/zi/zitadel/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ let
};
in
buildGoModule rec {
name = "zitadel";
pname = "zitadel";
inherit version;

src = zitadelRepo;
Expand Down
12 changes: 6 additions & 6 deletions pkgs/by-name/zo/zod/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
, substituteAll
}:
let
name = "zod-engine";
pname = "zod-engine";
version = "2011-09-06";
src = fetchzip {
url = "mirror://sourceforge/zod/linux_releases/zod_linux-${version}.tar.gz";
Expand All @@ -41,7 +41,7 @@ let
NIX_LDFLAGS = "-L${libmysqlclient}/lib/mysql";
zod_engine = stdenv.mkDerivation {
inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
pname = "${name}-engine";
pname = "${pname}-engine";
enableParallelBuilding = true;
preBuild = "cd zod_src";
installPhase = ''
Expand All @@ -52,7 +52,7 @@ let
};
zod_map_editor = stdenv.mkDerivation {
inherit version src postPatch nativeBuildInputs buildInputs hardeningDisable NIX_LDFLAGS;
pname = "${name}-map_editor";
pname = "${pname}-map_editor";
enableParallelBuilding = true;
preBuild = "cd zod_src";
makeFlags = [ "map_editor" ];
Expand All @@ -64,7 +64,7 @@ let
};
zod_launcher = stdenv.mkDerivation {
inherit version src nativeBuildInputs buildInputs zod_engine zod_map_editor;
pname = "${name}-launcher";
pname = "${pname}-launcher";
# This is necessary because the zod_launcher has terrible fixed-width window
# the Idea is to apply the scalingFactor to all positions and sizes and I tested 1,2,3 and 4
# 2,3,4 look acceptable on my 4k monitor and 1 is unreadable.
Expand All @@ -86,7 +86,7 @@ let
install -m755 zod_launcher $out/bin
'';
};
zod_assets = runCommandLocal "${name}-assets" {} ''
zod_assets = runCommandLocal "${pname}-assets" {} ''
mkdir -p $out/usr/lib/commander-zod{,blank_maps}
cp -r ${src}/assets $out/usr/lib/commander-zod/assets
for i in ${src}/*.map ${src}/*.txt; do
Expand All @@ -98,7 +98,7 @@ let
'';
in
symlinkJoin {
inherit name;
inherit pname version;
paths = [
zod_engine
zod_launcher
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/dscribe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}:

buildPythonPackage rec {
name = "dscribe";
pname = "dscribe";
version = "2.1.1";

src = fetchFromGitHub {
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/magic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
}:

buildPythonPackage {
name = pkgs.file.name;

src = pkgs.file.src;
inherit (pkgs.file) pname version src;

patchPhase = ''
substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/molbar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}:

buildPythonPackage rec {
name = "MolBar";
pname = "MolBar";
version = "1.1.1";

src = fetchgit {
Expand Down
12 changes: 5 additions & 7 deletions pkgs/games/xonotic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,16 @@ in rec {
rm -rf $(ls | grep -v "^data$" | grep -v "^key_0.d0pk$")
'';
meta.hydraPlatforms = [];
passthru.version = version;
inherit version pname;
};

xonotic = runCommand "xonotic${variant}-${version}" {
inherit xonotic-unwrapped;
inherit xonotic-unwrapped version;
pname = "${pname}${variant}";
nativeBuildInputs = [ makeWrapper copyDesktopItems ];
desktopItems = [ desktopItem ];
passthru = {
inherit version;
meta = meta // {
hydraPlatforms = [];
};
meta = meta // {
hydraPlatforms = [];
};
} (''
mkdir -p $out/bin
Expand Down

0 comments on commit 34ac189

Please sign in to comment.