Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 427516 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-28 / +24 lines)
Line  Link Here
0
-- picpuz-2.5/Makefile
0
++ picpuz-2.5/Makefile
Lines 11-34 Link Here
11
11
12
# target install directories
12
# target install directories
13
BINDIR = $(PREFIX)/bin
13
BINDIR = $(PREFIX)/bin
14
SHAREDIR = $(PREFIX)/share/$(PROGRAM)
14
DATADIR = $(PREFIX)/share/$(PROGRAM)
15
ICONDIR = $(SHAREDIR)/icons
15
ICONDIR = $(DATADIR)/icons
16
LOCALESDIR = $(SHAREDIR)/locales
16
LOCALESDIR = $(DATADIR)/locales
17
DOCDIR = $(PREFIX)/share/doc/$(PROGRAM)
17
DOCDIR = $(PREFIX)/share/doc/$(PROGRAM)
18
MANDIR = $(PREFIX)/share/man/man1
18
MANDIR = $(PREFIX)/share/man/man1
19
MENUFILE = $(PREFIX)/share/applications/kornelix-$(PROGRAM).desktop
19
MENUFILE = $(PREFIX)/share/applications/kornelix-$(PROGRAM).desktop
20
20
21
CFLAGS = $(CXXFLAGS) -c `pkg-config --cflags gtk+-3.0`
21
CXXFLAGS += -c `pkg-config --cflags gtk+-3.0`
22
LIBS = `pkg-config --libs gtk+-3.0`
22
LIBS = `pkg-config --libs gtk+-3.0`
23
23
24
$(PROGRAM): $(PROGRAM).o zfuncs.o
24
$(PROGRAM): $(PROGRAM).o zfuncs.o
25
	$(CXX) $(LDFLAGS) $(PROGRAM).o zfuncs.o $(LIBS) -o $(PROGRAM)
25
	$(CXX) $(LDFLAGS) $(PROGRAM).o zfuncs.o $(LIBS) -o $(PROGRAM)
26
26
27
$(PROGRAM).o: $(SOURCE)
27
$(PROGRAM).o: $(SOURCE)
28
	$(CXX) $(CFLAGS) -o $(PROGRAM).o $(SOURCE)
28
	$(CXX) $(CXXFLAGS) -o $(PROGRAM).o $(SOURCE) \
29
		-D "DATADIR=\"$(DATADIR)\"" -D "DOCDIR=\"$(DOCDIR)\""
29
30
30
zfuncs.o: zfuncs.cc
31
zfuncs.o: zfuncs.cc
31
	$(CXX) $(CFLAGS) zfuncs.cc -D PREFIX=\"$(PREFIX)\"
32
	$(CXX) $(CXXFLAGS) zfuncs.cc \
33
		-D "DATADIR=\"$(DATADIR)\"" -D "DOCDIR=\"$(DOCDIR)\"" -D "BINDIR=\"$(BINDIR)\""
32
34
33
install: $(PROGRAM)
35
install: $(PROGRAM)
34
	mkdir -p  $(DESTDIR)$(BINDIR)
36
	mkdir -p  $(DESTDIR)$(BINDIR)
Lines 52-58 Link Here
52
54
53
uninstall:
55
uninstall:
54
	rm -f  $(DESTDIR)$(BINDIR)/$(PROGRAM)
56
	rm -f  $(DESTDIR)$(BINDIR)/$(PROGRAM)
55
	rm -R -f  $(DESTDIR)$(SHAREDIR)
57
	rm -R -f  $(DESTDIR)$(DATADIR)
56
	rm -R -f  $(DESTDIR)$(DOCDIR)
58
	rm -R -f  $(DESTDIR)$(DOCDIR)
57
	rm -f  $(DESTDIR)$(MANDIR)/$(PROGRAM).1.gz
59
	rm -f  $(DESTDIR)$(MANDIR)/$(PROGRAM).1.gz
58
	xdg-desktop-menu uninstall $(DESTDIR)$(MENUFILE)
60
	xdg-desktop-menu uninstall $(DESTDIR)$(MENUFILE)
59
-- picpuz-2.5/zfuncs.cc
61
++ picpuz-2.5/zfuncs.cc
Lines 3111-3117 Link Here
3111
         /prefix/share/appname/locales/         translations: appname-de.po  etc.
3111
         /prefix/share/appname/locales/         translations: appname-de.po  etc.
3112
         /home/user/.appname/                   parameters etc. are copied here
3112
         /home/user/.appname/                   parameters etc. are copied here
3113
3113
3114
   zprefix        install location              has /bin and /share subtrees
3115
   zdatadir       installed data files          .desktop, parameters, etc.
3114
   zdatadir       installed data files          .desktop, parameters, etc.
3116
   zdocdir        user documentation            README, changelog, user guide
3115
   zdocdir        user documentation            README, changelog, user guide
3117
   zicondir       icons                         icon files .png
3116
   zicondir       icons                         icon files .png
Lines 3123-3129 Link Here
3123
namespace zfuncs
3122
namespace zfuncs
3124
{
3123
{
3125
   char        zappname[20];
3124
   char        zappname[20];
3126
   char        zprefix[200], zdatadir[200], zdocdir[200];                  //  app directories
3125
   char        zdatadir[200], zdocdir[200];                                //  app directories
3127
   char        zicondir[200], zlocalesdir[200], zuserdir[200];
3126
   char        zicondir[200], zlocalesdir[200], zuserdir[200];
3128
   char        zlang[8] = "en";                                            //  "lc" or "lc_RC"
3127
   char        zlang[8] = "en";                                            //  "lc" or "lc_RC"
3129
   char        JPGquality[4] = "85";                                       //  JPG file save quality
3128
   char        JPGquality[4] = "85";                                       //  JPG file save quality
Lines 3132-3138 Link Here
3132
   pthread_t   tid_main = 0;                                               //  main thread ID               v.4.8
3131
   pthread_t   tid_main = 0;                                               //  main thread ID               v.4.8
3133
}
3132
}
3134
3133
3135
cchar * get_zprefix() { return zfuncs::zprefix; }                          //  /usr or /home/<userid>
3136
cchar * get_zuserdir() { return zfuncs::zuserdir; }                        //  /home/user/.appname
3134
cchar * get_zuserdir() { return zfuncs::zuserdir; }                        //  /home/user/.appname
3137
cchar * get_zdatadir() { return zfuncs::zdatadir; }                        //  parameters, icons
3135
cchar * get_zdatadir() { return zfuncs::zdatadir; }                        //  parameters, icons
3138
cchar * get_zdocdir()  { return zfuncs::zdocdir;  }                        //  documentation files
3136
cchar * get_zdocdir()  { return zfuncs::zdocdir;  }                        //  documentation files
Lines 3156-3174 Link Here
3156
   
3154
   
3157
   catch_signals();                                                        //  catch segfault, do backtrace
3155
   catch_signals();                                                        //  catch segfault, do backtrace
3158
   
3156
   
3159
   strcpy(zappname,appname);                                               //  save app name
3157
   strcpy(zappname,appname);
3160
   
3158
3161
   #ifndef PREFIX                                                          //  install location                v.4.7
3159
   strcpy(zdatadir,DATADIR);                                               //  macros from build script
3162
      #define PREFIX "/usr"
3160
   strcpy(zdocdir,DOCDIR);
3163
   #endif
3161
   strcpy(zicondir,zdatadir);
3164
   
3162
   strcat(zicondir,"/icons");
3165
   strncpy0(work,PREFIX,199);                                              //  /usr or /home/<userid>          v.4.6
3163
   strcpy(zlocalesdir,zdatadir);
3166
   strcpy(zprefix,work);                                                   //  /prefix
3164
   strcat(zlocalesdir,"/locales");
3167
   strncatv(zdatadir,199,work,"/share/",zappname,"/data",null);            //  /prefix/share/appname/data
3165
3168
   strncatv(zicondir,199,work,"/share/",zappname,"/icons",null);           //  /prefix/share/appname/icons
3169
   strncatv(zlocalesdir,199,work,"/share/",zappname,"/locales",null);      //  /prefix/share/appname/locales
3170
   strncatv(zdocdir,199,work,"/share/doc/",zappname,null);                 //  /prefix/share/doc/appname
3171
   
3172
   snprintf(zuserdir,199,"%s/.%s",getenv("HOME"),zappname);                //  /home/user/.appname/            v.4.3
3166
   snprintf(zuserdir,199,"%s/.%s",getenv("HOME"),zappname);                //  /home/user/.appname/            v.4.3
3173
   err = stat(zuserdir,&statdat);                                          //  does it exist already?
3167
   err = stat(zuserdir,&statdat);                                          //  does it exist already?
3174
   if (err) {
3168
   if (err) {
Lines 3366-3374 Link Here
3366
   fputs(work,fid);
3360
   fputs(work,fid);
3367
   fputs("Type=Application\n",fid);                                        //  Type=Application
3361
   fputs("Type=Application\n",fid);                                        //  Type=Application
3368
   fputs("Terminal=false\n",fid);                                          //  Terminal=false
3362
   fputs("Terminal=false\n",fid);                                          //  Terminal=false
3369
   snprintf(work,199,"Exec=%s/bin/%s\n",zprefix,command);                  //  Exec=/usr/bin/appname -options
3363
   snprintf(work,199,"Exec=%s/%s\n",BINDIR,zappname);                  //  Exec=/usr/bin/appname -options
3370
   fputs(work,fid);
3364
   fputs(work,fid);
3371
   snprintf(work,199,"Icon=%s/%s.png\n",zicondir,appname);                 //  Icon=/usr/share/appname/icons/appname.png
3365
   snprintf(work,199,"Icon=%s/icons/%s.png\n",DATADIR,zappname);                 //  Icon=/usr/share/appname/icons/appname.png
3372
   fputs(work,fid);
3366
   fputs(work,fid);
3373
   fclose(fid);
3367
   fclose(fid);
3374
3368

Return to bug 427516