Unverified Commit a9b7e173 authored by midchildan's avatar midchildan
Browse files

onscripter-en: base package on onscripter

Also fix Darwin build.
parent c49d51b8
Loading
Loading
Loading
Loading
+87 −0
Original line number Diff line number Diff line
diff --git a/Info.plist b/Info.plist
index 977496b..615957f 100644
--- a/Info.plist
+++ b/Info.plist
@@ -1,4 +1,3 @@
-#include "../version.h"
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
diff --git a/ONScripter.xcodeproj/project.pbxproj b/ONScripter.xcodeproj/project.pbxproj
index db98945..49a7254 100644
--- a/ONScripter.xcodeproj/project.pbxproj
+++ b/ONScripter.xcodeproj/project.pbxproj
@@ -61,7 +61,6 @@
 		365D36490BE42E3F00D1832A /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A98430BE05D5E00786213 /* AudioUnit.framework */; };
 		365D36590BE42E3F00D1832A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A985B0BE05D8300786213 /* AudioToolbox.framework */; };
 		365D37360BE42E4100D1832A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A993F0BE05DBB00786213 /* IOKit.framework */; };
-		365D37D40BE42E4200D1832A /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A99E00BE05DCC00786213 /* QuickTime.framework */; };
 		365D37F60BE42E4200D1832A /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A9A050BE05E0800786213 /* Carbon.framework */; };
 		365D388C0BE42E4400D1832A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 365A98290BE05D3600786213 /* OpenGL.framework */; };
 		36D4F7A60D5D0C6D00B0FA18 /* DirPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36D4F7A40D5D0C6D00B0FA18 /* DirPaths.cpp */; };
@@ -407,7 +406,6 @@
 				365D36490BE42E3F00D1832A /* AudioUnit.framework in Frameworks */,
 				365D36590BE42E3F00D1832A /* AudioToolbox.framework in Frameworks */,
 				365D37360BE42E4100D1832A /* IOKit.framework in Frameworks */,
-				365D37D40BE42E4200D1832A /* QuickTime.framework in Frameworks */,
 				365D37F60BE42E4200D1832A /* Carbon.framework in Frameworks */,
 				365D388C0BE42E4400D1832A /* OpenGL.framework in Frameworks */,
 				E29F3440142C287C00052F81 /* libfreetype.a in Frameworks */,
@@ -988,6 +986,8 @@
 /* Begin PBXProject section */
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
 			isa = PBXProject;
+			attributes = {
+			};
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ONScripter" */;
 			compatibilityVersion = "Xcode 3.1";
 			developmentRegion = English;
@@ -1401,7 +1401,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				GCC_VERSION = com.apple.compilers.llvmgcc42;
+				GCC_VERSION = "";
+				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
@@ -1411,6 +1412,7 @@
 					"\"$(SRCROOT)/\"",
 				);
 				PREBINDING = NO;
+				SDKROOT = macosx;
 			};
 			name = Debug;
 		};
@@ -1418,13 +1420,10 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = (
-					x86_64,
-					i386,
-				);
+				ARCHS = "$(ARCHS_STANDARD)";
 				GCC_OPTIMIZATION_LEVEL = 2;
-				GCC_VERSION = 4.0;
-				"GCC_VERSION[sdk=macosx10.6][arch=*]" = com.apple.compilers.llvmgcc42;
+				GCC_VERSION = "";
+				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
@@ -1436,10 +1435,11 @@
 				OTHER_CPLUSPLUSFLAGS = (
 					"-Wl,--gc-sections",
 					"$(OTHER_CFLAGS)",
+					"-Wno-format-security",
+					"-Wno-narrowing",
 				);
 				PREBINDING = NO;
-				SDKROOT = macosx10.4;
-				"SDKROOT[arch=x86_64]" = macosx10.6;
+				SDKROOT = macosx;
 			};
 			name = Release;
 		};
+75 −53
Original line number Diff line number Diff line
{
  lib,
  SDL,
  SDL_image,
  SDL_mixer,
  SDL_ttf,
  buildEnv,
  fetchFromGitHub,
  freetype,
  libjpeg,
  libogg,
  libpng,
  libvorbis,
  makeBinaryWrapper,
  onscripter,
  pkg-config,
  smpeg,
  stdenv,
  xcbuildHook,
}:

stdenv.mkDerivation (finalAttrs: {
let
  inherit (onscripter) stdenv;
in
onscripter.overrideAttrs (
  final: prev: {
    pname = "onscripter-en";
    version = "20110930";

@@ -23,44 +20,69 @@ stdenv.mkDerivation (finalAttrs: {
    src = fetchFromGitHub {
      owner = "museoa";
      repo = "onscripter-en";
    rev = finalAttrs.version;
      rev = final.version;
      hash = "sha256-Lc5ZlH2C4ER02NmQ6icfiqpzVQdVUnOmdywGjjjSYSg=";
    };

  nativeBuildInputs = [
    SDL
    pkg-config
    smpeg
    patches = lib.optionals stdenv.isDarwin [
      # Build with newer compilers and SDKs
      ./fix-darwin-build.patch
    ];

  buildInputs = [
    SDL
    SDL_image
    SDL_mixer
    SDL_ttf
    freetype
    libjpeg
    libogg
    libpng
    libvorbis
    smpeg
    sourceRoot = lib.optionalDrvAttr stdenv.isDarwin "source/macosx";

    nativeBuildInputs =
      prev.nativeBuildInputs
      ++ [ pkg-config ]
      ++ lib.optionals stdenv.isDarwin [
        makeBinaryWrapper
        xcbuildHook
      ];

  configureFlags = [ "--no-werror" ];
    preUnpack =
      let
        onscrlib = buildEnv {
          name = "onscrlib";
          paths = final.buildInputs;
          extraOutputsToInstall = [ "dev" ];
          extraPrefix = "/onscrlib";
        };
      in
      lib.optionalString stdenv.isDarwin ''
        ln -s ${onscrlib} onscrlib
      '';

    configureFlags = [
      "--no-werror"
    ]
    ++ lib.optionals (!stdenv.cc.isGNU) [
      "--unsupported-compiler"
    ];

  strictDeps = true;
    makefile = "Makefile";

  preBuild = ''
    preBuild = lib.optionalString (!stdenv.isDarwin) ''
      sed -i 's/.dll//g' Makefile
    '';

    installPhase = lib.optionalDrvAttr stdenv.isDarwin ''
      runHook preInstall

      mkdir -p $out/{bin,Applications}
      cp -R Products/Release/ONScripter.app $out/Applications
      makeWrapper $out/Applications/ONScripter.app/Contents/MacOS/ONScripter \
        $out/bin/${lib.escapeShellArg final.meta.mainProgram}

      runHook postInstall
    '';

    meta = {
      homepage = "https://github.com/museoa/onscripter-en";
    description = "Japanese visual novel scripting engine";
      description = "English-focused fork of ONScripter";
      license = lib.licenses.gpl2Plus;
      mainProgram = "onscripter-en";
      maintainers = [ ];
      platforms = lib.platforms.unix;
    broken = stdenv.hostPlatform.isDarwin;
    };
})
  }
)