neix: various build fixes Don't hard-code the build environment's $HOME as the basis for the default user configuration path, and use consistent means to check for this path. Don't install configuration files in $HOME during the build. This package also expects C++11.diff -r1.1 -r1.2 pkgsrc/news/neix/Makefile
(gutteridge)
@@ -1,28 +1,29 @@ | @@ -1,28 +1,29 @@ | |||
1 | # $NetBSD: Makefile,v 1.1 2021/01/06 18:08:53 pin Exp $ | 1 | # $NetBSD: Makefile,v 1.2 2021/02/07 05:06:12 gutteridge Exp $ | |
2 | 2 | |||
3 | DISTNAME= neix-0.1.3 | 3 | DISTNAME= neix-0.1.3 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= news | 5 | CATEGORIES= news | |
5 | MASTER_SITES= ${MASTER_SITE_GITHUB:=tomschwarz/} | 6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=tomschwarz/} | |
6 | GITHUB_TAG= v${PKGVERSION_NOREV} | 7 | GITHUB_TAG= v${PKGVERSION_NOREV} | |
7 | 8 | |||
8 | MAINTAINER= pin@NetBSD.org | 9 | MAINTAINER= pin@NetBSD.org | |
9 | HOMEPAGE= https://github.com/tomschwarz/neix/ | 10 | HOMEPAGE= https://github.com/tomschwarz/neix/ | |
10 | COMMENT= RSS/Atom feed reader for your terminal | 11 | COMMENT= RSS/Atom feed reader for your terminal | |
11 | LICENSE= gnu-gpl-v3 | 12 | LICENSE= gnu-gpl-v3 | |
12 | 13 | |||
13 | USE_CMAKE= yes | 14 | USE_CMAKE= yes | |
14 | USE_TOOLS+= pkg-config gmake | 15 | USE_TOOLS+= pkg-config gmake | |
15 | USE_LANGUAGES= c c++ | 16 | USE_LANGUAGES= c c++11 | |
16 | 17 | |||
17 | CONFIGURE_DIRS= build | 18 | CONFIGURE_DIRS= build | |
18 | CMAKE_ARG_PATH= .. | 19 | CMAKE_ARG_PATH= .. | |
19 | 20 | |||
20 | CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX=${PREFIX} | 21 | CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX=${PREFIX} | |
21 | 22 | |||
22 | SUBST_CLASSES+= prefix | 23 | SUBST_CLASSES+= prefix | |
23 | SUBST_MESSAGE.prefix= Fixing paths. | 24 | SUBST_MESSAGE.prefix= Fixing paths. | |
24 | SUBST_STAGE.prefix= pre-configure | 25 | SUBST_STAGE.prefix= pre-configure | |
25 | SUBST_FILES.prefix+= CMakeLists.txt | 26 | SUBST_FILES.prefix+= CMakeLists.txt | |
26 | SUBST_SED.prefix+= -e 's,share/man,${PKGMANDIR},g' | 27 | SUBST_SED.prefix+= -e 's,share/man,${PKGMANDIR},g' | |
27 | 28 | |||
28 | pre-configure: | 29 | pre-configure: |
@@ -1,6 +1,8 @@ | @@ -1,6 +1,8 @@ | |||
1 | $NetBSD: distinfo,v 1.1 2021/01/06 18:08:53 pin Exp $ | 1 | $NetBSD: distinfo,v 1.2 2021/02/07 05:06:12 gutteridge Exp $ | |
2 | 2 | |||
3 | SHA1 (neix-0.1.3.tar.gz) = 8f6902fa54b178d8b3c4fa5f99afe072fa3a91a7 | 3 | SHA1 (neix-0.1.3.tar.gz) = 8f6902fa54b178d8b3c4fa5f99afe072fa3a91a7 | |
4 | RMD160 (neix-0.1.3.tar.gz) = 17d60fac3f5ae8846433095448b44a78d2278a06 | 4 | RMD160 (neix-0.1.3.tar.gz) = 17d60fac3f5ae8846433095448b44a78d2278a06 | |
5 | SHA512 (neix-0.1.3.tar.gz) = 34bbb32ace34a32785a1f6ad9524532a5a98bf2f33b0ce2aaec3e2e5389a4171050100c47fbef7ee83ba044d163e7f39498e6fe32bc343d4772833b195a55cd3 | 5 | SHA512 (neix-0.1.3.tar.gz) = 34bbb32ace34a32785a1f6ad9524532a5a98bf2f33b0ce2aaec3e2e5389a4171050100c47fbef7ee83ba044d163e7f39498e6fe32bc343d4772833b195a55cd3 | |
6 | Size (neix-0.1.3.tar.gz) = 20161083 bytes | 6 | Size (neix-0.1.3.tar.gz) = 20161083 bytes | |
7 | SHA1 (patch-CMakeLists.txt) = dd830009a096010d9f4567575b1198e271426d16 | |||
8 | SHA1 (patch-src_main.cpp) = d8b5512b94300f05fba0328fff4375f0cd15a169 |
$NetBSD: patch-CMakeLists.txt,v 1.1 2021/02/07 05:06:12 gutteridge Exp $
Don't install configuration files in $HOME during the build.
Don't hard-code the build environment's $HOME as the basis for the default
user configuration path.
--- CMakeLists.txt.orig 2020-09-07 19:55:08.000000000 +0000
+++ CMakeLists.txt
@@ -22,19 +22,6 @@ SET(CURSES_NEED_NCURSES TRUE)
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIRS})
-# Prepare filesystem for installation
-file(MAKE_DIRECTORY $ENV{HOME}/.config/neix/)
-
-# Check for main config file
-if(NOT EXISTS "$ENV{HOME}/.config/neix/neix.conf")
- configure_file(./config/neix.conf $ENV{HOME}/.config/neix/neix.conf)
-endif()
-
-# Check for feed config file
-if(NOT EXISTS "$ENV{HOME}/.config/neix/feeds.conf")
- configure_file(./config/feeds.conf $ENV{HOME}/.config/neix/feeds.conf)
-endif()
-
# Version
set(neixVersion "0.1.3")
add_compile_definitions(VERSION="v${neixVersion}")
@@ -47,14 +34,6 @@ add_compile_definitions(NEIX_USER_AGENT=
add_compile_definitions(DEFAULT_MAIN_CONFIG="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/neix/neix.conf")
add_compile_definitions(DEFAULT_FEEDS_CONFIG="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/neix/feeds.conf")
-# Path for main neix config file
-set(MainConfigPath "$ENV{HOME}/.config/neix/neix.conf")
-add_compile_definitions(MAIN_CONFIG_PATH="${MainConfigPath}")
-
-# Path for feed config file
-set(FeedConfigPath "$ENV{HOME}/.config/neix/feeds.conf")
-add_compile_definitions(FEED_CONFIG_PATH="${FeedConfigPath}")
-
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
$NetBSD: patch-src_main.cpp,v 1.1 2021/02/07 05:06:12 gutteridge Exp $
Consistently determine the user's configuration path at runtime, don't use a
hard-coded value that was defined as the build environment's $HOME.
--- src/main.cpp.orig 2020-09-07 19:55:08.000000000 +0000
+++ src/main.cpp
@@ -35,7 +35,7 @@ void processArguments(int argc, char **a
case 'i':
cout << prefix << "Import feeds from: " << optarg << endl;
- imported = opml::import(optarg, FEED_CONFIG_PATH);
+ imported = opml::import(optarg, getFeedConfigPath());
cout << prefix << imported << " feed(s) was imported" << endl;
break;