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 context 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,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2021/01/06 18:08:53 pin Exp $
+# $NetBSD: Makefile,v 1.2 2021/02/07 05:06:12 gutteridge Exp $
 
 DISTNAME=	neix-0.1.3
+PKGREVISION=	1
 CATEGORIES=	news
 MASTER_SITES=	${MASTER_SITE_GITHUB:=tomschwarz/}
 GITHUB_TAG=	v${PKGVERSION_NOREV}
@@ -12,7 +13,7 @@
 
 USE_CMAKE=	yes
 USE_TOOLS+=	pkg-config gmake
-USE_LANGUAGES=	c c++
+USE_LANGUAGES=	c c++11
 
 CONFIGURE_DIRS=	build
 CMAKE_ARG_PATH=	..

cvs diff -r1.1 -r1.2 pkgsrc/news/neix/distinfo (expand / switch to context 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 @@
-$NetBSD: distinfo,v 1.1 2021/01/06 18:08:53 pin Exp $
+$NetBSD: distinfo,v 1.2 2021/02/07 05:06:12 gutteridge Exp $
 
 SHA1 (neix-0.1.3.tar.gz) = 8f6902fa54b178d8b3c4fa5f99afe072fa3a91a7
 RMD160 (neix-0.1.3.tar.gz) = 17d60fac3f5ae8846433095448b44a78d2278a06
 SHA512 (neix-0.1.3.tar.gz) = 34bbb32ace34a32785a1f6ad9524532a5a98bf2f33b0ce2aaec3e2e5389a4171050100c47fbef7ee83ba044d163e7f39498e6fe32bc343d4772833b195a55cd3
 Size (neix-0.1.3.tar.gz) = 20161083 bytes
+SHA1 (patch-CMakeLists.txt) = dd830009a096010d9f4567575b1198e271426d16
+SHA1 (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;