From 95045873de2b058ae7fb4895a37774acf64639e7 Mon Sep 17 00:00:00 2001 From: Lorem Date: Sat, 20 Jun 2020 12:03:41 +0530 Subject: [PATCH] CPU-X: update to 4.0.1. - No longer needs libcurl and json-c dependencies - Add patch to fix i686* build - Add patch to fix build on musl Closes: #23090 [via git-merge-pr] --- .../patches/define_ACCESSPERMS_on_musl.patch | 15 +++++++++++++++ srcpkgs/CPU-X/patches/fix-no-pie-check.patch | 18 ++++++++---------- .../CPU-X/patches/fix_bitness_detection.patch | 17 +++++++++++++++++ srcpkgs/CPU-X/template | 17 +++++++---------- 4 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 srcpkgs/CPU-X/patches/define_ACCESSPERMS_on_musl.patch create mode 100644 srcpkgs/CPU-X/patches/fix_bitness_detection.patch diff --git a/srcpkgs/CPU-X/patches/define_ACCESSPERMS_on_musl.patch b/srcpkgs/CPU-X/patches/define_ACCESSPERMS_on_musl.patch new file mode 100644 index 00000000000..f4df56c5e70 --- /dev/null +++ b/srcpkgs/CPU-X/patches/define_ACCESSPERMS_on_musl.patch @@ -0,0 +1,15 @@ +--- src/util.c ++++ src/util.c +@@ -35,6 +35,12 @@ + #include + #include + #include ++ ++/* glibc's stat.h has it but musl's does not. */ ++#ifndef ACCESSPERMS ++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ++#endif ++ + #include + #include "cpu-x.h" + #include "ipc.h" diff --git a/srcpkgs/CPU-X/patches/fix-no-pie-check.patch b/srcpkgs/CPU-X/patches/fix-no-pie-check.patch index ac1ef59b2f1..267dbb3843a 100644 --- a/srcpkgs/CPU-X/patches/fix-no-pie-check.patch +++ b/srcpkgs/CPU-X/patches/fix-no-pie-check.patch @@ -1,18 +1,16 @@ This shouldn't exist and erroneously fails for us. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index dca0029..93b8c79 100644 --- CMakeLists.txt +++ CMakeLists.txt -@@ -32,10 +32,6 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack - - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") +@@ -35,12 +35,6 @@ + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") - include(CheckCCompilerFlag) +-include(CheckCCompilerFlag) -check_c_compiler_flag("-no-pie" HAS_NO_PIE) --if(HAS_NO_PIE) +-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND HAS_NO_PIE) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") --endif(HAS_NO_PIE) - +-endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND HAS_NO_PIE) +- # Options option(WITH_GTK "Build support for GUI in GTK3+" ON) - + option(WITH_NCURSES "Build support for TUI in NCurses" ON) diff --git a/srcpkgs/CPU-X/patches/fix_bitness_detection.patch b/srcpkgs/CPU-X/patches/fix_bitness_detection.patch new file mode 100644 index 00000000000..f5965948f15 --- /dev/null +++ b/srcpkgs/CPU-X/patches/fix_bitness_detection.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -25,11 +25,11 @@ + set(APP_EXEC ${CMAKE_PROJECT_NAME}) + set(DAEMON_EXEC ${CMAKE_PROJECT_NAME}-daemon) + set(DAEMON_PATH ${CMAKE_INSTALL_FULL_LIBEXECDIR}/${DAEMON_EXEC}) +-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") ++if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(BITNESS "32") +-else(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") ++else(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(BITNESS "64") +-endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") ++endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-result") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Wuninitialized -Wstrict-prototypes -Wformat -Wformat-security") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") diff --git a/srcpkgs/CPU-X/template b/srcpkgs/CPU-X/template index 2c6621d888b..0947bcfef81 100644 --- a/srcpkgs/CPU-X/template +++ b/srcpkgs/CPU-X/template @@ -1,21 +1,18 @@ # Template file for 'CPU-X' pkgname=CPU-X -version=3.2.4 -revision=3 -# /usr/bin/ld: i386:x86-64 architecture of input file -# ../output/lib/libbandwidth.a(routines-x86-64bit.o)' -# is incompatible with i386 output -archs="x86_64*" +version=4.0.1 +revision=1 +archs="x86_64* i686*" build_style=cmake -hostmakedepends="nasm pkg-config" -makedepends="libcpuid-devel libcurl-devel ncurses-devel pciutils-devel - procps-ng-devel json-c-devel $(vopt_if gtk3 'gtk+3-devel')" +hostmakedepends="nasm pkg-config gettext" +makedepends="libcpuid-devel ncurses-devel pciutils-devel + procps-ng-devel $(vopt_if gtk3 'gtk+3-devel')" short_desc="Free software that gathers information on CPU, motherboard and more" maintainer="Orphaned " license="GPL-3.0-or-later" homepage="https://x0rg.github.io/CPU-X/" distfiles="https://github.com/X0rg/CPU-X/archive/v${version}.tar.gz" -checksum=f266388e13c527a5d1d98ec70957b1284f67aa89470cf71bc98ecb41c21542eb +checksum=c41fbb3000e3e6f79e5228aa0237fde4f98b11df8ccb4c9a46f7e63a4a7011bf build_options="gtk3" build_options_default="gtk3"