From 495df12c7382327d7cb688f6188ca97a9936a3ca Mon Sep 17 00:00:00 2001 From: BatteredBunny Date: Tue, 21 Jul 2026 16:55:40 +0300 Subject: [PATCH] gphoto2fs: 0.5.0 -> 1.0; modernize --- pkgs/by-name/gp/gphoto2fs/package.nix | 50 +++++++++++++++++++-------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/gp/gphoto2fs/package.nix b/pkgs/by-name/gp/gphoto2fs/package.nix index c6ed189ad97c..f554d06f9ac9 100644 --- a/pkgs/by-name/gp/gphoto2fs/package.nix +++ b/pkgs/by-name/gp/gphoto2fs/package.nix @@ -1,39 +1,61 @@ { lib, stdenv, - fetchurl, - libtool, + fetchFromGitHub, + autoreconfHook, pkg-config, + gettext, + libtool, libgphoto2, - fuse, + fuse3, glib, }: stdenv.mkDerivation (finalAttrs: { pname = "gphoto2fs"; - version = "0.5.0"; - src = fetchurl { - url = "mirror://sourceforge/gphoto/gphotofs/${finalAttrs.version}/gphotofs-0.5.tar.bz2"; - hash = "sha256-Z27E3mmoHBk//DG9x7WHrCosw3gLFPDnycTApRezQ8w="; + version = "1.0"; + + __structuredAttrs = true; + strictDeps = true; + + src = fetchFromGitHub { + owner = "gphoto"; + repo = "gphotofs"; + tag = "v${finalAttrs.version}"; + hash = "sha256-3DdL4FQzLEzvREhoZYfZlzZvyow/EATN/Q0HtOmdWKA="; }; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + gettext + libtool + glib + ]; + buildInputs = [ libgphoto2 - fuse + fuse3 glib - libtool ]; + # gphotofs_init() still declares the FUSE 2 callback signature, which GCC 14 rejects + env = lib.optionalAttrs stdenv.cc.isGNU { + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; + }; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/gphotofs --help > /dev/null + ''; + meta = { description = "Fuse FS to mount a digital camera"; mainProgram = "gphotofs"; homepage = "http://www.gphoto.org/"; + changelog = "https://github.com/gphoto/gphotofs/releases/tag/${finalAttrs.src.tag}"; maintainers = [ lib.maintainers.raskin ]; platforms = lib.platforms.linux; - license = with lib.licenses; [ - lgpl2 - gpl2 - ]; + license = lib.licenses.gpl2Only; }; })