1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 22:20:51 +00:00

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.
This commit is contained in:
Maxwell Beck 2021-06-23 19:12:38 -05:00
parent 0e07b4ec9e
commit 4556893019
No known key found for this signature in database
GPG key ID: 465DC9FAC329753A
2 changed files with 9 additions and 32 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, libtool }:
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake }:
stdenv.mkDerivation rec {
pname = "pystring";
@ -11,14 +11,17 @@ stdenv.mkDerivation rec {
sha256 = "1w31pjiyshqgk6zd6m3ab3xfgb0ribi77r6fwrry2aw8w1adjknf";
};
nativeBuildInputs = [ libtool ];
patches = [
(fetchpatch {
name = "pystring-cmake-configuration.patch";
url = "https://github.com/imageworks/pystring/commit/4f653fc35421129eae8a2c424901ca7170059370.patch";
sha256 = "1hynzz76ff4vvmi6kwixsmjswkpyj6s4vv05d7nw0zscj4cdp8k3";
})
];
patches = [ ./makefile.patch ];
nativeBuildInputs = [ cmake ];
doCheck = true;
checkTarget = "test";
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/imageworks/pystring/";

View file

@ -1,26 +0,0 @@
--- pystring/Makefile.orig 2020-02-04 03:24:44.000000000 -0300
+++ pystring/Makefile 2020-11-20 20:23:07.314247959 -0300
@@ -1,7 +1,9 @@
-LIBTOOL = libtool
-LIBDIR = /usr/lib
-CXX = g++
-CXXFLAGS = -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2
+LIBTOOL ?= libtool
+PREFIX ?= /usr
+INCLUDEDIR = ${PREFIX}/include/pystring
+LIBDIR = ${PREFIX}/lib
+CXX ?= g++
+CXXFLAGS ?= -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 -fPIC
all: libpystring.la
@@ -12,7 +14,8 @@
$(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $< -rpath $(LIBDIR)
install: libpystring.la
- $(LIBTOOL) --mode=install install -c $< $(LIBDIR)/$<
+ $(LIBTOOL) --mode=install install -Dm755 $< $(DESTDIR)$(LIBDIR)/$<
+ $(LIBTOOL) --mode=install install -Dm644 pystring.h $(DESTDIR)$(INCLUDEDIR)/pystring.h
clean:
$(RM) -fr pystring.lo pystring.o libpystring.la .libs