From 36cb620fb6ece5bf2f8ec521fdedb72a94f4d2e8 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 2 Dec 2024 05:17:00 +0100 Subject: [PATCH 1/3] got: format --- pkgs/by-name/go/got/package.nix | 110 +++++++++++++++++++------------- 1 file changed, 66 insertions(+), 44 deletions(-) diff --git a/pkgs/by-name/go/got/package.nix b/pkgs/by-name/go/got/package.nix index 3259ce5711e6..a9b873a9dcae 100644 --- a/pkgs/by-name/go/got/package.nix +++ b/pkgs/by-name/go/got/package.nix @@ -1,29 +1,34 @@ -{ lib -, stdenv -, fetchurl -, pkg-config -, libressl -, libbsd -, libevent -, libuuid -, libossp_uuid -, libmd -, zlib -, ncurses -, bison -, autoPatchelfHook -, testers -, signify -, overrideSDK -, withSsh ? true, openssh -# Default editor to use when neither VISUAL nor EDITOR are defined -, defaultEditor ? null +{ + lib, + stdenv, + fetchurl, + pkg-config, + libressl, + libbsd, + libevent, + libuuid, + libossp_uuid, + libmd, + zlib, + ncurses, + bison, + autoPatchelfHook, + testers, + signify, + overrideSDK, + nix-update-script, + withSsh ? true, + openssh, + # Default editor to use when neither VISUAL nor EDITOR are defined + defaultEditor ? null, }: let - stdenv' = if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 - then overrideSDK stdenv "11.0" - else stdenv; + stdenv' = + if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then + overrideSDK stdenv "11.0" + else + stdenv; in stdenv'.mkDerivation (finalAttrs: { pname = "got"; @@ -34,11 +39,20 @@ stdenv'.mkDerivation (finalAttrs: { hash = "sha256-MHnXQsElBH3jOd2SPXXQuWCZWjpLVn7QjvNtESvbB8w="; }; - nativeBuildInputs = [ pkg-config bison ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + nativeBuildInputs = [ + pkg-config + bison + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = [ libressl libbsd libevent libuuid libmd zlib ncurses ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libossp_uuid ]; + buildInputs = [ + libressl + libbsd + libevent + libuuid + libmd + zlib + ncurses + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libossp_uuid ]; preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' # The configure script assumes dependencies on Darwin are installed via @@ -48,22 +62,27 @@ stdenv'.mkDerivation (finalAttrs: { ''; env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals (defaultEditor != null) [ - ''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"'' - ] ++ lib.optionals withSsh [ - ''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"'' - ''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"'' - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - ''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"'' - ] ++ lib.optionals stdenv.cc.isClang [ - "-Wno-error=implicit-function-declaration" - "-Wno-error=int-conversion" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # error: conflicting types for 'strmode' - "-DHAVE_STRMODE=1" - # Undefined symbols for architecture arm64: "_bsd_getopt" - "-include getopt.h" - ]); + lib.optionals (defaultEditor != null) [ + ''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"'' + ] + ++ lib.optionals withSsh [ + ''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"'' + ''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"'' + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"'' + ] + ++ lib.optionals stdenv.cc.isClang [ + "-Wno-error=implicit-function-declaration" + "-Wno-error=int-conversion" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # error: conflicting types for 'strmode' + "-DHAVE_STRMODE=1" + # Undefined symbols for architecture arm64: "_bsd_getopt" + "-include getopt.h" + ] + ); passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; @@ -83,7 +102,10 @@ stdenv'.mkDerivation (finalAttrs: { ''; homepage = "https://gameoftrees.org"; license = lib.licenses.isc; - maintainers = with lib.maintainers; [ abbe afh ]; + maintainers = with lib.maintainers; [ + abbe + afh + ]; mainProgram = "got"; platforms = with lib.platforms; darwin ++ linux; }; From eb454c6e989b64b238dd1cc21d420e457abb0771 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 2 Dec 2024 05:18:18 +0100 Subject: [PATCH 2/3] got: use nix-update-script --- pkgs/by-name/go/got/package.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/go/got/package.nix b/pkgs/by-name/go/got/package.nix index a9b873a9dcae..30eb0be47b6a 100644 --- a/pkgs/by-name/go/got/package.nix +++ b/pkgs/by-name/go/got/package.nix @@ -84,8 +84,13 @@ stdenv'.mkDerivation (finalAttrs: { ] ); - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; + passthru = { + updateScript = nix-update-script { + extraArgs = [ "--url=https://github.com/ThomasAdam/got-portable" ]; + }; + tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; }; meta = { From fdbbb617af0bf2948218db823aa6b4f99b31c014 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 5 Jan 2025 15:44:12 +0100 Subject: [PATCH 3/3] got: 0.106 -> 0.108 --- pkgs/by-name/go/got/package.nix | 38 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/go/got/package.nix b/pkgs/by-name/go/got/package.nix index 30eb0be47b6a..4bed26de212a 100644 --- a/pkgs/by-name/go/got/package.nix +++ b/pkgs/by-name/go/got/package.nix @@ -15,7 +15,7 @@ autoPatchelfHook, testers, signify, - overrideSDK, + apple-sdk_15, nix-update-script, withSsh ? true, openssh, @@ -23,20 +23,13 @@ defaultEditor ? null, }: -let - stdenv' = - if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then - overrideSDK stdenv "11.0" - else - stdenv; -in -stdenv'.mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "got"; - version = "0.106"; + version = "0.108"; src = fetchurl { url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz"; - hash = "sha256-MHnXQsElBH3jOd2SPXXQuWCZWjpLVn7QjvNtESvbB8w="; + hash = "sha256-bI0yCt01h65HwG2jLUH+5Ah+1mGTG6ZNxt53v0Mr0+I="; }; nativeBuildInputs = [ @@ -44,15 +37,20 @@ stdenv'.mkDerivation (finalAttrs: { bison ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = [ - libressl - libbsd - libevent - libuuid - libmd - zlib - ncurses - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libossp_uuid ]; + buildInputs = + [ + libressl + libbsd + libevent + libuuid + libmd + zlib + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libossp_uuid + apple-sdk_15 + ]; preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' # The configure script assumes dependencies on Darwin are installed via