pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

grafX2: Get paths from pkgsrc



Module Name:	pkgsrc-wip
Committed By:	Nia Alarie <nia.alarie%gmail.com@localhost>
Pushed By:	nee
Date:		Wed Aug 16 19:57:46 2017 +0100
Changeset:	02171e2054885d23fdf6819cc887645d2b7d841c

Modified Files:
	grafX2/Makefile
	grafX2/distinfo
	grafX2/patches/patch-setup.c

Log Message:
grafX2: Get paths from pkgsrc

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=02171e2054885d23fdf6819cc887645d2b7d841c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 grafX2/Makefile              |  3 +-
 grafX2/distinfo              |  2 +-
 grafX2/patches/patch-setup.c | 74 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+), 2 deletions(-)

diffs:
diff --git a/grafX2/Makefile b/grafX2/Makefile
index 4742f1767e..fbfa96e033 100644
--- a/grafX2/Makefile
+++ b/grafX2/Makefile
@@ -16,7 +16,8 @@ WRKSRC=		${WRKDIR}/${GITLAB_PROJECT}-${GITLAB_REV}-${GITLAB_TAG}/src
 
 USE_TOOLS=	pkg-config gmake
 
-MAKE_FLAGS=	prefix=${PREFIX}
+MAKE_FLAGS+=	prefix=${PREFIX}
+CFLAGS+=	-DPREFIX=\"${PREFIX}\"
 
 .include "../../devel/SDL/buildlink3.mk"
 .include "../../devel/SDL_ttf/buildlink3.mk"
diff --git a/grafX2/distinfo b/grafX2/distinfo
index 9910adc447..205db7a4e4 100644
--- a/grafX2/distinfo
+++ b/grafX2/distinfo
@@ -5,4 +5,4 @@ RMD160 (grafX2-2.4.tar.gz) = ac77f23fab86c5df9c0ab77964e81295371a874f
 SHA512 (grafX2-2.4.tar.gz) = 357d3f9f6b1f2f05130686d57590f00e8327db2f6d04c8ea8e5879a2d9824f612d77123cbcb08788d6aac9effacf1aa96043000cf6b667952d738aaf69d78642
 Size (grafX2-2.4.tar.gz) = 1632859 bytes
 SHA1 (patch-realpath.c) = c3e9a36e0edac36aea5cc51e80fc8bceae0f1cce
-SHA1 (patch-setup.c) = 31727e80d2f54bc12b128212070af08182e07a9a
+SHA1 (patch-setup.c) = 8cc104558fb7b5d261d749a793d95786bbfbe3f9
diff --git a/grafX2/patches/patch-setup.c b/grafX2/patches/patch-setup.c
index dbe7f4acd3..4349101221 100644
--- a/grafX2/patches/patch-setup.c
+++ b/grafX2/patches/patch-setup.c
@@ -2,6 +2,8 @@ $NetBSD$
 
 Don't discriminate against unix-like systems.
 
+Pick up paths from pkgsrc.
+
 --- setup.c.orig	2012-12-05 00:18:04.000000000 +0000
 +++ setup.c
 @@ -39,7 +39,7 @@
@@ -13,3 +15,75 @@ Don't discriminate against unix-like systems.
    #include <limits.h>
    #include <unistd.h>
  #endif
+@@ -71,44 +71,7 @@ int Create_ConfigDirectory(char * config
+ void Set_program_directory(const char * argv0,char * program_dir)
+ {
+   (void)argv0; // unused sometimes
+-  
+-  // MacOSX
+-  #if defined(__macosx__)
+-    CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+-    CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN);
+-    CFRelease(url);
+-    // Append trailing slash
+-    strcat(program_dir    ,"/");
+-  
+-  // AmigaOS and alike: hard-coded volume name.
+-  #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
+-    strcpy(program_dir,"PROGDIR:");
+-  #elif defined(__MINT__)
+-  static char path[1024]={0};
+-  char currentDrive='A';
+-  currentDrive=currentDrive+Dgetdrv();
+-  
+-  Dgetpath(path,0);
+-  sprintf(program_dir,"%c:\%s",currentDrive,path);
+-  // Append trailing slash
+-  strcat(program_dir,PATH_SEPARATOR);
+-  // Linux: argv[0] unreliable
+-  #elif defined(__linux__)
+-  if (argv0[0]!='/')
+-  {
+-    char path[PATH_MAX];
+-    readlink("/proc/self/exe", path, sizeof(path));
+-    Extract_path(program_dir, path);
+-    return;
+-  }  
+-  Extract_path(program_dir, argv0);
+-  
+-  // Others: The part of argv[0] before the executable name.    
+-  // Keep the last \ or /.
+-  // On Windows, Mingw32 already provides the full path in all cases.
+-  #else
+-    Extract_path(program_dir, argv0);
+-  #endif
++  strcpy(program_dir, PREFIX "/bin/");
+ }
+ 
+ // Determine which directory contains the read-only data.
+@@ -116,23 +79,8 @@ void Set_program_directory(const char *
+ // OUT: Write into data_dir. Trailing / or \ is kept.
+ void Set_data_directory(const char * program_dir, char * data_dir)
+ {
+-  // On all platforms, data is relative to the executable's directory
+-  strcpy(data_dir,program_dir);
+-  // On MacOSX,  it is stored in a special folder:
+-  #if defined(__macosx__)
+-    strcat(data_dir,"Contents/Resources/");
+-  // On GP2X, executable is not in bin/
+-  #elif defined (__GP2X__) || defined (__gp2x__) || defined (__WIZ__) || defined (__CAANOO__)
+-    strcat(data_dir,"share/grafx2/");
+-  //on tos the same directory
+-  #elif defined (__MINT__)
+-    strcpy(data_dir, program_dir);
+-  // All other targets, program is in a "bin" subdirectory
+-  #elif defined (__AROS__)
+-    strcat(data_dir,"share/grafx2/");
+-  #else
+-    strcat(data_dir,"../share/grafx2/");
+-  #endif
++  (void)program_dir;
++  strcpy(data_dir, PREFIX "/share/grafx2/");
+ }
+ 
+ // Determine which directory should store the user's configuration.


Home | Main Index | Thread Index | Old Index