Sun Feb 7 05:06:12 2021 UTC ()
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.


(gutteridge)
diff -r1.1 -r1.2 pkgsrc/news/neix/Makefile
diff -r1.1 -r1.2 pkgsrc/news/neix/distinfo
diff -r0 -r1.1 pkgsrc/news/neix/patches/patch-CMakeLists.txt
diff -r0 -r1.1 pkgsrc/news/neix/patches/patch-src_main.cpp

cvs diff -r1.1 -r1.2 pkgsrc/news/neix/Makefile (expand / switch to unified diff)

--- pkgsrc/news/neix/Makefile 2021/01/06 18:08:53 1.1
+++ pkgsrc/news/neix/Makefile 2021/02/07 05:06:12 1.2
@@ -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
3DISTNAME= neix-0.1.3 3DISTNAME= neix-0.1.3
 4PKGREVISION= 1
4CATEGORIES= news 5CATEGORIES= news
5MASTER_SITES= ${MASTER_SITE_GITHUB:=tomschwarz/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=tomschwarz/}
6GITHUB_TAG= v${PKGVERSION_NOREV} 7GITHUB_TAG= v${PKGVERSION_NOREV}
7 8
8MAINTAINER= pin@NetBSD.org 9MAINTAINER= pin@NetBSD.org
9HOMEPAGE= https://github.com/tomschwarz/neix/ 10HOMEPAGE= https://github.com/tomschwarz/neix/
10COMMENT= RSS/Atom feed reader for your terminal 11COMMENT= RSS/Atom feed reader for your terminal
11LICENSE= gnu-gpl-v3 12LICENSE= gnu-gpl-v3
12 13
13USE_CMAKE= yes 14USE_CMAKE= yes
14USE_TOOLS+= pkg-config gmake 15USE_TOOLS+= pkg-config gmake
15USE_LANGUAGES= c c++ 16USE_LANGUAGES= c c++11
16 17
17CONFIGURE_DIRS= build 18CONFIGURE_DIRS= build
18CMAKE_ARG_PATH= .. 19CMAKE_ARG_PATH= ..
19 20
20CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX=${PREFIX} 21CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX=${PREFIX}
21 22
22SUBST_CLASSES+= prefix 23SUBST_CLASSES+= prefix
23SUBST_MESSAGE.prefix= Fixing paths. 24SUBST_MESSAGE.prefix= Fixing paths.
24SUBST_STAGE.prefix= pre-configure 25SUBST_STAGE.prefix= pre-configure
25SUBST_FILES.prefix+= CMakeLists.txt 26SUBST_FILES.prefix+= CMakeLists.txt
26SUBST_SED.prefix+= -e 's,share/man,${PKGMANDIR},g' 27SUBST_SED.prefix+= -e 's,share/man,${PKGMANDIR},g'
27 28
28pre-configure: 29pre-configure:

cvs diff -r1.1 -r1.2 pkgsrc/news/neix/distinfo (expand / switch to unified diff)

--- pkgsrc/news/neix/distinfo 2021/01/06 18:08:53 1.1
+++ pkgsrc/news/neix/distinfo 2021/02/07 05:06:12 1.2
@@ -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
3SHA1 (neix-0.1.3.tar.gz) = 8f6902fa54b178d8b3c4fa5f99afe072fa3a91a7 3SHA1 (neix-0.1.3.tar.gz) = 8f6902fa54b178d8b3c4fa5f99afe072fa3a91a7
4RMD160 (neix-0.1.3.tar.gz) = 17d60fac3f5ae8846433095448b44a78d2278a06 4RMD160 (neix-0.1.3.tar.gz) = 17d60fac3f5ae8846433095448b44a78d2278a06
5SHA512 (neix-0.1.3.tar.gz) = 34bbb32ace34a32785a1f6ad9524532a5a98bf2f33b0ce2aaec3e2e5389a4171050100c47fbef7ee83ba044d163e7f39498e6fe32bc343d4772833b195a55cd3 5SHA512 (neix-0.1.3.tar.gz) = 34bbb32ace34a32785a1f6ad9524532a5a98bf2f33b0ce2aaec3e2e5389a4171050100c47fbef7ee83ba044d163e7f39498e6fe32bc343d4772833b195a55cd3
6Size (neix-0.1.3.tar.gz) = 20161083 bytes 6Size (neix-0.1.3.tar.gz) = 20161083 bytes
 7SHA1 (patch-CMakeLists.txt) = dd830009a096010d9f4567575b1198e271426d16
 8SHA1 (patch-src_main.cpp) = d8b5512b94300f05fba0328fff4375f0cd15a169

File Added: pkgsrc/news/neix/patches/patch-CMakeLists.txt
$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)

File Added: pkgsrc/news/neix/patches/Attic/patch-src_main.cpp
$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;