Commit ea16a90e authored by Yavor Doganov's avatar Yavor Doganov

make-v2-strict.patch: New; fix FTBFS with strict v2 mode (#897620).

parent 3ad858db
......@@ -13,6 +13,8 @@ wrapperfactory.app (0.1.0-5) UNRELEASED; urgency=medium
* debian/patches/05_objdir.dpatch: Delete, no longer necessary.
* debian/patches/10_libGSWrapper_libobjc.dpatch: Rename as...
* debian/patches/link-libs.patch: ...and quiltify.
* debian/patches/make-v2-strict.patch: New; fix FTBFS with gnustep-make
in strict v2 mode, adapt code to a v2 environment (Closes: #897620).
* debian/README.source: Delete; useless.
* debian/menu: Delete as per policy requirement.
* debian/manpages: New file.
......
Description: Fix FTBFS with gnustep-make in strict v2 mode.
Also adapt the app to the removal of the 1.x compatibility mode: some
variables are obsolete and are no longer defined while normally
nothing is exported in the environment.
Debian-Bug: https://bugs.debian.org/897620
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2018-05-10
---
--- wrapperfactory.app.orig/GNUmakefile
+++ wrapperfactory.app/GNUmakefile
@@ -19,15 +19,9 @@
include $(GNUSTEP_MAKEFILES)/common.make
-include Directories.make
-
-GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
-
PACKAGE_NAME=GNUstepWrapper
include Version
-GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
-
#$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(LIBRARY_COMBO)/GSWrapper_Launcher
SUBPROJECTS = libGSWrapper Launcher WrapperFactory
--- wrapperfactory.app.orig/Launcher/GNUmakefile
+++ wrapperfactory.app/Launcher/GNUmakefile
@@ -19,23 +19,19 @@
include $(GNUSTEP_MAKEFILES)/common.make
-include ../Directories.make
-
-GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_SYSTEM_ROOT)
-
-OBJC_PROGRAM_NAME=GSWrapper_Launcher
+TOOL_NAME=GSWrapper_Launcher
GSWrapper_Launcher_OBJC_FILES=main.m
-GSWrapper_Launcher_OBJC_LIBS += -lGSWrapper -lgnustep-base -lgnustep-gui
+GSWrapper_Launcher_TOOL_LIBS += -lGSWrapper -lgnustep-base -lgnustep-gui
GSWrapper_Launcher_INCLUDE_DIRS += -I../libGSWrapper
-GSWrapper_Launcher_LIB_DIRS += -L../libGSWrapper/$(OBJ_DIR)
+GSWrapper_Launcher_LIB_DIRS += -L../libGSWrapper/obj
-GSWrapper_Launcher_COPY_INTO_LOCAL_BUNDLE = ../$(APP_DIR)/Resources/$(ARCH_DIR)
+GSWrapper_Launcher_COPY_INTO_DIR = \
+ ../WrapperFactory/WrapperFactory.app/Resources
-include GNUmakefile.preamble
ifeq ($(GSWrapper_Development),yes)
include ../GNUmakefile.development
endif
-include $(GNUSTEP_MAKEFILES)/objc.make
--include GNUmakefile.postamble
+include $(GNUSTEP_MAKEFILES)/tool.make
--- wrapperfactory.app.orig/WrapperFactory/GNUmakefile
+++ wrapperfactory.app/WrapperFactory/GNUmakefile
@@ -19,8 +19,6 @@
include $(GNUSTEP_MAKEFILES)/common.make
-include ../Directories.make
-
APP_NAME=WrapperFactory
WrapperFactory_OBJC_FILES = main.m \
@@ -50,7 +48,6 @@
include ../GNUmakefile.development
endif
include $(GNUSTEP_MAKEFILES)/application.make
--include GNUmakefile.postamble
ifeq ($(GSWrapper_Development),yes)
include GNUmakefile.development.post
endif
--- wrapperfactory.app.orig/libGSWrapper/GNUmakefile
+++ wrapperfactory.app/libGSWrapper/GNUmakefile
@@ -19,9 +19,6 @@
include $(GNUSTEP_MAKEFILES)/common.make
-
-GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_SYSTEM_ROOT)
-
LIBRARY_NAME=libGSWrapper
libGSWrapper_OBJC_FILES = WrapperDelegate.m \
--- wrapperfactory.app.orig/WrapperFactory/ServicesProvider.m
+++ wrapperfactory.app/WrapperFactory/ServicesProvider.m
@@ -35,12 +35,13 @@
userData: (NSString *)userData
error: (NSString **)error
{
+ NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSDocumentController *documentController = [NSDocumentController sharedDocumentController];
NSArray *files = [pboard propertyListForType: NSFilenamesPboardType];
NSString *file;
NSString *appName;
WrapperDocument *doc;
- NSString *userRoot = [[[NSProcessInfo processInfo] environment] objectForKey: @"GNUSTEP_USER_ROOT"];
+ NSString *userRoot = [defs objectForKey: @"GNUSTEP_USER_DIR_APPS"];
int i;
int count = [files count];
BOOL shouldCreate = [documentController shouldCreateUI];
@@ -56,8 +57,8 @@
appName = [NSString stringWithFormat: @"%@.app", [file lastPathComponent]];
[doc setName: appName];
appName = [NSString pathWithComponents: [NSArray arrayWithObjects:
+ NSHomeDirectory(),
userRoot,
- @"Applications",
appName,
nil]];
--- wrapperfactory.app.orig/WrapperFactory/WrapperDocument.m
+++ wrapperfactory.app/WrapperFactory/WrapperDocument.m
@@ -80,6 +80,39 @@
@end
+/* Obtain a variable's value with gnustep-config. Assumes that
+ * gnustep-config is in PATH which should be the case for all
+ * installations. */
+static NSString *
+getVar(NSString *var)
+{
+ NSPipe *pipe = [NSPipe pipe];
+ NSFileHandle *handle = [pipe fileHandleForReading];
+ NSTask *task = [NSTask new];
+ NSString *output, *value;
+
+ [task setLaunchPath: @"gnustep-config"];
+ [task setArguments: [NSArray arrayWithObjects:
+ [NSString stringWithFormat: @"--variable=%@",
+ var], nil]];
+ [task setStandardOutput: pipe];
+ [task launch];
+ output = [[NSString alloc] initWithData: [handle readDataToEndOfFile]
+ encoding: NSUTF8StringEncoding];
+ value = [output stringByTrimmingCharactersInSet:
+ [NSCharacterSet newlineCharacterSet]];
+ [handle closeFile];
+
+ if ( [value isEqualToString: @""] || [task terminationStatus] != 0 )
+ [NSException raise: NSParseErrorException
+ format: @"Could not obtain the %@ variable", var];
+
+ RELEASE(task);
+ RELEASE(output);
+
+ return value;
+}
+
@implementation AppFileWrapper
- (void)dealloc
@@ -824,12 +857,15 @@
- (NSFileWrapper *)saveWrapper
{
-
- NSString *flattenedString = [[[NSProcessInfo processInfo] environment] objectForKey: @"GNUSTEP_FLATTENED"];
- BOOL flattened;
+ /* Try to obtain GNUSTEP_IS_FLATTENED from the environment, in
+ * case GNUSTEP_SH_EXPORT_ALL_VARIABLES is defined. Resort to the
+ * slower method if it's not exported. */
+ NSString *flattenedString = [[[NSProcessInfo processInfo] environment] objectForKey: @"GNUSTEP_IS_FLATTENED"];
+ BOOL flattened = NO;
if ( flattenedString == nil ) {
- NSLog(@"GNUSTEP_FLATTENED not set");
- flattened = NO;
+ flattenedString = getVar(@"GNUSTEP_IS_FLATTENED");
+ if ( [flattenedString isEqualToString: @""] )
+ NSLog(@"GNUSTEP_IS_FLATTENED not set");
}
else {
flattened = [flattenedString isEqualToString: @"yes"];
@@ -954,6 +990,13 @@
[environment objectForKey: @"LIBRARY_COMBO"],
nil];
+ if ( [exePathComponents count] < 3 )
+ exePathComponents = [NSArray arrayWithObjects:
+ getVar(@"GNUSTEP_HOST_CPU"),
+ getVar(@"GNUSTEP_HOST_OS"),
+ getVar(@"LIBRARY_COMBO"),
+ nil];
+
NSData *script;
if ( flattened ) {
script = nil;
link-libs.patch
make-v2-strict.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment