pystring: Use CMake build

Has a pull request open on the upstream repo, thus may be upstreamed in
the future as opposed to the previous makefile patch.

+9 -32
+9 -6
pkgs/development/libraries/pystring/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, libtool }: 1 + { stdenv, lib, fetchFromGitHub, fetchpatch, cmake }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "pystring"; ··· 11 11 sha256 = "1w31pjiyshqgk6zd6m3ab3xfgb0ribi77r6fwrry2aw8w1adjknf"; 12 12 }; 13 13 14 - nativeBuildInputs = [ libtool ]; 14 + patches = [ 15 + (fetchpatch { 16 + name = "pystring-cmake-configuration.patch"; 17 + url = "https://github.com/imageworks/pystring/commit/4f653fc35421129eae8a2c424901ca7170059370.patch"; 18 + sha256 = "1hynzz76ff4vvmi6kwixsmjswkpyj6s4vv05d7nw0zscj4cdp8k3"; 19 + }) 20 + ]; 15 21 16 - patches = [ ./makefile.patch ]; 22 + nativeBuildInputs = [ cmake ]; 17 23 18 24 doCheck = true; 19 - checkTarget = "test"; 20 - 21 - makeFlags = [ "PREFIX=$(out)" ]; 22 25 23 26 meta = with lib; { 24 27 homepage = "https://github.com/imageworks/pystring/";
-26
pkgs/development/libraries/pystring/makefile.patch
··· 1 - --- pystring/Makefile.orig 2020-02-04 03:24:44.000000000 -0300 2 - +++ pystring/Makefile 2020-11-20 20:23:07.314247959 -0300 3 - @@ -1,7 +1,9 @@ 4 - -LIBTOOL = libtool 5 - -LIBDIR = /usr/lib 6 - -CXX = g++ 7 - -CXXFLAGS = -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 8 - +LIBTOOL ?= libtool 9 - +PREFIX ?= /usr 10 - +INCLUDEDIR = ${PREFIX}/include/pystring 11 - +LIBDIR = ${PREFIX}/lib 12 - +CXX ?= g++ 13 - +CXXFLAGS ?= -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 -fPIC 14 - 15 - all: libpystring.la 16 - 17 - @@ -12,7 +14,8 @@ 18 - $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $< -rpath $(LIBDIR) 19 - 20 - install: libpystring.la 21 - - $(LIBTOOL) --mode=install install -c $< $(LIBDIR)/$< 22 - + $(LIBTOOL) --mode=install install -Dm755 $< $(DESTDIR)$(LIBDIR)/$< 23 - + $(LIBTOOL) --mode=install install -Dm644 pystring.h $(DESTDIR)$(INCLUDEDIR)/pystring.h 24 - 25 - clean: 26 - $(RM) -fr pystring.lo pystring.o libpystring.la .libs