Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmtp, libgphoto2, gphoto2: Switch to Github, allow building from repo #104000

Merged
merged 3 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions pkgs/applications/misc/gphoto2/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
{ stdenv, fetchurl, pkgconfig, libgphoto2, libexif, popt, gettext
, libjpeg, readline, libtool
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
, gettext
, libexif
, libgphoto2
, libjpeg
, libtool
, popt
, readline
}:

stdenv.mkDerivation rec {
name = "gphoto2-2.5.26";
pname = "gphoto2";
version = "2.5.26";

src = fetchurl {
url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
sha256 = "0bxbcn31xalsvjp8fra324hf2105y3ps7zlyfz11v71j0lxj2lvn";
src = fetchFromGitHub {
owner = "gphoto";
repo = "gphoto2";
rev = "v${version}";
sha256 = "1w01j3qvjl2nlfs38rnsmjvn3r0r2xf7prxz1i6yarbpj3fzwqqc";
};

nativeBuildInputs = [ pkgconfig gettext libtool ];
buildInputs = [ libgphoto2 libexif popt libjpeg readline ];
nativeBuildInputs = [
autoreconfHook
pkgconfig
gettext
libtool
];

buildInputs = [
libexif
libgphoto2
libjpeg
popt
readline
];

meta = with stdenv.lib; {
description = "A ready to use set of digital camera software applications";
Expand Down
27 changes: 20 additions & 7 deletions pkgs/development/libraries/libgphoto2/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
{ stdenv, fetchFromGitHub, pkgconfig, libusb1, libtool, libexif, libjpeg, gettext, autoreconfHook }:
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gettext
, libusb1
, libtool
, libexif
, libjpeg
}:

stdenv.mkDerivation rec {
name = "libgphoto2-${meta.version}";
pname = "libgphoto2";
version = "2.5.23";

src = fetchFromGitHub {
owner = "gphoto";
repo = "libgphoto2";
rev = meta.tag;
rev = "libgphoto2-${builtins.replaceStrings [ "." ] [ "_" ] version}-release";
sha256 = "1sc2ycx11khf0qzp1cqxxx1qymv6bjfbkx3vvbwz6wnbyvsigxz2";
};

patches = [];

nativeBuildInputs = [ pkgconfig gettext autoreconfHook ];
buildInputs = [ libtool libjpeg libusb1 ];
nativeBuildInputs = [
autoreconfHook
pkgconfig
gettext
libtool
];

buildInputs = [
libjpeg
libusb1
];

# These are mentioned in the Requires line of libgphoto's pkg-config file.
propagatedBuildInputs = [ libexif ];
Expand All @@ -33,8 +48,6 @@ stdenv.mkDerivation rec {
MTP, and other vendor specific protocols for controlling and transferring data
from digital cameras.
'';
version = "2.5.23";
tag = "libgphoto2-2_5_23-release";
# XXX: the homepage claims LGPL, but several src files are lgpl21Plus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the XXX: mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a way to indicate a sort of TODO or ugliness note, but I don't think it's good, exactly because it isn't obvious what it means.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recognized the writing style as mine, but I didn't remember writing that comment.

Git blame claims I wrote it 8 years ago!

The upstream project now reports: GNU Lesser General Public License v2.1. Let's use that.

Copy link
Member

@jtojnar jtojnar Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcumming Unfortunately, the GitHub license detector is not able to determine if the license is *gpl-or-later or *gpl-only, see https://discourse.nixos.org/t/lib-licenses-gpl3-co-are-now-deprecated/8206 for more details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it to you people to figure that one out 😁

Beyond that, anybody mind approving if it looks good?

license = stdenv.lib.licenses.lgpl21Plus;
platforms = with stdenv.lib.platforms; unix;
Expand Down
38 changes: 30 additions & 8 deletions pkgs/development/libraries/libmtp/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
{ stdenv, fetchurl, pkgconfig, libusb1, libiconv }:
{ stdenv, fetchFromGitHub, autoconf, automake, gettext, libtool, pkgconfig
, libusb1
, libiconv
}:

stdenv.mkDerivation rec {
name = "libmtp-1.1.18";
pname = "libmtp";
version = "1.1.18";

src = fetchurl {
url = "mirror://sourceforge/libmtp/${name}.tar.gz";
sha256 = "1w41l93yi0dmw218daiw36rylkc8rammxx37csh1ij24q18gx03j";
src = fetchFromGitHub {
owner = "libmtp";
repo = "libmtp";
rev = "libmtp-${builtins.replaceStrings [ "." ] [ "-" ] version}";
sha256 = "0lniy0xq397zddlhsv6n4qjn0wwakli5p3ydzxmbzn0z0jgngjja";
};

outputs = [ "bin" "dev" "out" ];

buildInputs = [ libiconv ];
propagatedBuildInputs = [ libusb1 ];
nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [
autoconf
automake
gettext
libtool
pkgconfig
];

buildInputs = [
libiconv
];

propagatedBuildInputs = [
libusb1
];

preConfigure = ''
./autogen.sh
'';

# tried to install files to /lib/udev, hopefully OK
configureFlags = [ "--with-udev=$$bin/lib/udev" ];
Expand Down