nvidia-settings 387.34, added libxnvctrl

This commit is contained in:
AlmAck 2018-01-06 13:42:53 +01:00
parent 9afdc88e43
commit 3027d81d7a
2 changed files with 112 additions and 29 deletions

View File

@ -1,42 +1,58 @@
# maintainer: AlmAck <gluca86@gmail.com>
pkgname=nvidia-settings
_pkgbasename=nvidia
pkgver=387.22
pkgbase=nvidia-settings
pkgname=('nvidia-settings' 'libxnvctrl')
pkgver=387.34
pkgrel=1
pkgdesc="Tool for configuring the NVIDIA graphics driver"
url='https://github.com/NVIDIA/nvidia-settings'
arch=('x86_64')
pkgdesc="Gtk Graphical User Interface for nVidia"
depends=('gtk3' 'pangox-compat' $_pkgbasename=$pkgver)
optdepends=('gtk2: use gtk2 for interface')
url="http://www.nvidia.com/"
license=('custom')
options=('!strip')
source=("ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
#source+=("NVIDIA-Linux-x86_64-${pkgver}.run::https://developer.nvidia.com/linux64bit")
license=('GPL2')
makedepends=('git' 'inetutils' 'gtk2' 'jansson' 'gtk3' 'libxv' 'libvdpau' 'nvidia-utils' 'libxext')
options=('staticlibs')
source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/NVIDIA/nvidia-settings/archive/${pkgver}.tar.gz
libxnvctrl_so.patch)
sha512sums=('559c859c0740575ab93edce013587250b98d7d2cd55198b5103fe97423d31ed9f113d83c240c402404de88074c285a07e46342538610d3d5dade7bed59d60090'
'f69f5dc84fe624579a3c9ce877f4ae4e34c2184877576afbea07b8abdd7ff01e470517f2b77cd11a904518cbcb83fb388ca1d08888006f0ef2854723920c9cf8')
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
#_pkg="NVIDIA-Linux-x86_64-${pkgver}"
source+=('nvidia-restore-settings.desktop')
md5sums=('b21f9bafb20409b337505c9b1d362c34'
'9237516792da7b6df32f8c7e8a98f475')
prepare() {
export PREFIX=/usr
export NV_USE_BUNDLED_LIBJANSSON=0
cd ${pkgbase}-${pkgver}
patch -p1 < "${srcdir}/libxnvctrl_so.patch"
}
build() {
sh "${_pkg}.run" --extract-only
cd ${pkgbase}-${pkgver}
make
make -C src/libXNVCtrl
}
package() {
cd "${srcdir}/${_pkg}"
package_nvidia-settings() {
depends=('jansson' 'gtk3' 'libxv' 'libvdpau' 'libxnvctrl' "nvidia-utils=$pkgver")
install -D -m755 nvidia-settings "${pkgdir}/usr/bin/nvidia-settings"
install -D -m644 nvidia-settings.1.gz "${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz"
install -D -m644 nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
install -D -m644 nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
install -D -m755 "libnvidia-gtk2.so.$pkgver" "$pkgdir/usr/lib/libnvidia-gtk2.so.$pkgver"
install -D -m755 "libnvidia-gtk3.so.$pkgver" "$pkgdir/usr/lib/libnvidia-gtk3.so.$pkgver"
cd ${pkgbase}-${pkgver}
make DESTDIR="${pkgdir}" install
install -D -m644 doc/nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
install -D -m644 doc/nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
# Install the autostart .desktop file, so that parameters saved through nvidia-settings
# are automatically reloaded at each login
install -D -m644 "${srcdir}/nvidia-restore-settings.desktop" "${pkgdir}/etc/xdg/autostart/nvidia-restore-settings.desktop"
rm "$pkgdir/usr/lib/libnvidia-gtk2.so.$pkgver"
}
package_libxnvctrl() {
depends=('libxext')
pkgdesc='NVIDIA NV-CONTROL X extension'
cd ${pkgbase}-${pkgver}
install -Dm 644 doc/{NV-CONTROL-API.txt,FRAMELOCK.txt} -t "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm 644 samples/{Makefile,README,*.c,*.h,*.mk} -t "${pkgdir}/usr/share/doc/${pkgname}/samples"
cd src/libXNVCtrl
install -Dm 644 *.h -t "${pkgdir}/usr/include/NVCtrl"
install -Dm 644 libXNVCtrl.a -t "${pkgdir}/usr/lib"
install -Dm 755 libXNVCtrl.so.0.0.0 -t "${pkgdir}/usr/lib"
ln -s libXNVCtrl.so.0.0.0 "${pkgdir}/usr/lib/libXNVCtrl.so.0"
ln -s libXNVCtrl.so.0 "${pkgdir}/usr/lib/libXNVCtrl.so"
}

View File

@ -0,0 +1,67 @@
--- a/src/Makefile
+++ b/src/Makefile
@@ -106,6 +106,8 @@
XNVCTRL_DIR ?= libXNVCtrl
XNVCTRL_MAKEFILE ?= Makefile
XNVCTRL_ARCHIVE ?= $(XNVCTRL_DIR)/libXNVCtrl.a
+XNVCTRL_SHARED ?= $(XNVCTRL_DIR)/libXNVCtrl.so.0
+XNVCTRL_LIB ?= $(XNVCTRL_SHARED)
XCONFIG_PARSER_DIR ?= XF86Config-parser
COMMON_UTILS_DIR ?= common-utils
COMMON_UNIX_DIR ?= common-unix
@@ -280,15 +282,18 @@
$(MKDIR) $(BINDIR)
$(INSTALL) $(INSTALL_BIN_ARGS) $< $(BINDIR)/$(notdir $<)
+$(XNVCTRL_ARCHIVE) $(XNVCTRL_SHARED):
+ $(MAKE) -C $(XNVCTRL_DIR)
+
$(eval $(call DEBUG_INFO_RULES, $(NVIDIA_SETTINGS)))
-$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(XNVCTRL_ARCHIVE)
+$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(XNVCTRL_LIB)
$(call quiet_cmd,LINK) $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
- -rdynamic -o $@ $(OBJS) $(XNVCTRL_ARCHIVE) $(LIBS)
+ -rdynamic -o $@ $(OBJS) $(XNVCTRL_LIB) $(LIBS)
$(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS) \
+ $(XNVCTRL_LIB) $(LIBS) $(GTK2_LIBS) \
-Wl,--unresolved-symbols=ignore-all -o $@ \
-Wl,-soname -Wl,$(GTK2LIB_SONAME) \
$(GTK2_OBJS) $(XCP_OBJS)
@@ -297,7 +302,7 @@
$(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
$(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS) \
+ $(XNVCTRL_LIB) $(LIBS) $(GTK3_LIBS) \
-Wl,--unresolved-symbols=ignore-all -o $@ \
-Wl,-soname -Wl,$(GTK3LIB_SONAME) \
$(GTK3_OBJS) $(XCP_OBJS)
--- a/src/libXNVCtrl/Makefile
+++ b/src/libXNVCtrl/Makefile
@@ -55,10 +55,17 @@
.PHONY: clean
all: $(LIBXNVCTRL)
+all: libXNVCtrl.so
$(LIBXNVCTRL) : $(OBJS)
$(AR) ru $@ $(OBJS)
+libXNVCtrl.so: $(OBJS)
+ $(RM) $@ $@.*
+ $(CC) -shared -Wl,-soname=$@.0 -o $@.0.0.0 $(LDFLAGS) $^ -lXext -lX11
+ ln -s $@.0.0.0 $@.0
+ ln -s $@.0 $@
+
# define the rule to build each object file
$(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
@@ -68,3 +75,4 @@
clean:
rm -rf $(LIBXNVCTRL) *~ $(STAMP_C) \
$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d
+ rm -f libXNVCtrl.so libXNVCtrl.so.*