Re: [swift-users] Wrapping ImageMagick in a Swift Package

2017-10-04 Thread Toni Suter via swift-users
Hi Ankit,

Thank you very much! It works now :-)

Best regards,
Toni

> Am 03.10.2017 um 21:50 schrieb Ankit Aggarwal :
> 
> Hi Toni,
> 
> You're not supposed to build the system module package (because there is 
> nothing to build). Tag and add this package as a dependency and then try to 
> import the `TestPkg` module that you defined in the modulemap. The error here 
> is bogus and is tracked by https://bugs.swift.org/browse/SR-5383 
> 
> 
> On Tue, Oct 3, 2017 at 12:32 AM, Toni Suter via swift-users 
> > wrote:
> Hi,
> 
> I am trying to create a Swift Package that wraps the ImageMagick C API. So I 
> installed ImageMagick using MacPorts and
> I was then able to build the sample program with the following commands:
> 
> export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
> cc main.c `pkg-config --cflags --libs MagickWand`
> 
> Then I created a package with the command "swift package init 
> --type=system-module" and I modified Package.swift to look
> like this:
> 
> // swift-tools-version:4.0
> 
> import PackageDescription
> 
> let package = Package(
>   name: "TestPkg",
>   pkgConfig: "MagickWand"
> )
> 
> and I modified module.modulemap to the following:
> 
> module TestPkg [system] {
>   header "/opt/local/include/ImageMagick-6/wand/MagickWand.h"
>   link "MagickWand-6.Q16"
>   link "MagickCore-6.Q16"
>   export *
> }
> 
> Now when I run "swift build", I get the following error message:
> 
> :0: error: unexpected 'commands' value (expected map)
> :0: error: unable to load build file
> error: terminated(1): 
> /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-08-27-a.xctoolchain/usr/bin/swift-build-tool
>  -f /Users/tonisuter/Desktop/TestPkg/.build/debug.yaml main
> 
> Does anybody know how I can fix this error?
> 
> Thanks and best regards
> Toni
> 
> ___
> swift-users mailing list
> swift-users@swift.org 
> https://lists.swift.org/mailman/listinfo/swift-users 
> 
> 
> 

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Wrapping ImageMagick in a Swift Package

2017-10-03 Thread Ankit Aggarwal via swift-users
Hi Toni,

You're not supposed to build the system module package (because there is
nothing to build). Tag and add this package as a dependency and then try to
import the `TestPkg` module that you defined in the modulemap. The error
here is bogus and is tracked by https://bugs.swift.org/browse/SR-5383

On Tue, Oct 3, 2017 at 12:32 AM, Toni Suter via swift-users <
swift-users@swift.org> wrote:

> Hi,
>
> I am trying to create a Swift Package that wraps the ImageMagick C API. So
> I installed ImageMagick using MacPorts and
> I was then able to build the sample program with the following commands:
>
> export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
> cc main.c `pkg-config --cflags --libs MagickWand`
>
> Then I created a package with the command "swift package init
> --type=system-module" and I modified Package.swift to look
> like this:
>
> // swift-tools-version:4.0
>
> import PackageDescription
>
> let package = Package(
> name: "TestPkg",
> pkgConfig: "MagickWand"
> )
>
> and I modified module.modulemap to the following:
>
> module TestPkg [system] {
>   header "/opt/local/include/ImageMagick-6/wand/MagickWand.h"
>   link "MagickWand-6.Q16"
>   link "MagickCore-6.Q16"
>   export *
> }
>
> Now when I run "swift build", I get the following error message:
>
> :0: error: unexpected 'commands' value (expected map)
> :0: error: unable to load build file
> error: terminated(1): /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-
> SNAPSHOT-2017-08-27-a.xctoolchain/usr/bin/swift-build-tool -f
> /Users/tonisuter/Desktop/TestPkg/.build/debug.yaml main
>
> Does anybody know how I can fix this error?
>
> Thanks and best regards
> Toni
>
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
>
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] Wrapping ImageMagick in a Swift Package

2017-10-03 Thread Toni Suter via swift-users
Hi,

I am trying to create a Swift Package that wraps the ImageMagick C API. So I 
installed ImageMagick using MacPorts and
I was then able to build the sample program with the following commands:

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
cc main.c `pkg-config --cflags --libs MagickWand`

Then I created a package with the command "swift package init 
--type=system-module" and I modified Package.swift to look
like this:

// swift-tools-version:4.0

import PackageDescription

let package = Package(
name: "TestPkg",
pkgConfig: "MagickWand"
)

and I modified module.modulemap to the following:

module TestPkg [system] {
  header "/opt/local/include/ImageMagick-6/wand/MagickWand.h"
  link "MagickWand-6.Q16"
  link "MagickCore-6.Q16"
  export *
}

Now when I run "swift build", I get the following error message:

:0: error: unexpected 'commands' value (expected map)
:0: error: unable to load build file
error: terminated(1): 
/Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-08-27-a.xctoolchain/usr/bin/swift-build-tool
 -f /Users/tonisuter/Desktop/TestPkg/.build/debug.yaml main

Does anybody know how I can fix this error?

Thanks and best regards
Toni___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users