diff --git a/pkgs/applications/misc/gphoto2/add-type-casts.diff b/pkgs/applications/misc/gphoto2/add-type-casts.diff new file mode 100644 index 000000000000..fd0f6f88c331 --- /dev/null +++ b/pkgs/applications/misc/gphoto2/add-type-casts.diff @@ -0,0 +1,21 @@ +diff --git a/gphoto2/main.c b/gphoto2/main.c +index 2bf5964..cd84467 100644 +--- a/gphoto2/main.c ++++ b/gphoto2/main.c +@@ -1215,14 +1215,14 @@ start_timeout_func (Camera *camera, unsigned int timeout, + + pthread_create (&tid, NULL, thread_func, td); + +- return (tid); ++ return (unsigned int)tid; + } + + static void + stop_timeout_func (Camera __unused__ *camera, unsigned int id, + void __unused__ *data) + { +- pthread_t tid = id; ++ pthread_t tid = (pthread_t)id; + + pthread_cancel (tid); + pthread_join (tid, NULL); diff --git a/pkgs/applications/misc/gphoto2/default.nix b/pkgs/applications/misc/gphoto2/default.nix index cf2d0c633c37..42037008d0ef 100644 --- a/pkgs/applications/misc/gphoto2/default.nix +++ b/pkgs/applications/misc/gphoto2/default.nix @@ -1,11 +1,16 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config -, gettext -, libexif -, libgphoto2 -, libjpeg -, libtool -, popt -, readline +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + pkg-config, + gettext, + libexif, + libgphoto2, + libjpeg, + libtool, + popt, + readline, }: stdenv.mkDerivation rec { @@ -19,6 +24,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-t5EnM4WaDbOTPM+rJW+hQxBgNErnnZEN9lZvxTKoDhA="; }; + patches = [ ./add-type-casts.diff ]; + nativeBuildInputs = [ autoreconfHook pkg-config