ohanhi / elm-native-ui

[CLOSED] Experiment: mobile apps in Elm using React Native.
BSD 3-Clause "New" or "Revised" License
1.54k stars 76 forks source link

Building elm-make in ubuntu #30

Closed sudhirvkumar closed 8 years ago

sudhirvkumar commented 8 years ago

@ohanhi Thanks for the great work with the PoC.

Its working fine in Mac with the Binary elm-make in the built folder.

When I try to build elm-make in Ubuntu with GHC 7.10.3 and Cabal 1.22.4 everything builds just fine.

I used the modified BuildFromSource.hs file which is available as a Gist https://gist.github.com/sudhirvkumar/cc8f6c55ca49876e07f3906d774214eb

I have forked the repositories into AtomicITS organization so that its easy to use that script

https://github.com/AtomicITS/

Everything compiled and I copied the elm-make from the cabal sandbox/bin folder into ~/bin which is available in my path and overrides existing elm-make

I have done all self publish stuff with the core and elm-native-ui

when I run npm run compile I get the following error

`The 'main' value has an unsupported type.

14│ main : Signal Ui.NativeUi ^^^^^^^^^^^^^^^^^^^^^^^^^ I need an Element, Html, (Signal Element), or (Signal Html) so I can render it on screen, but you gave me:

Signal Ui.NativeUi

Detected errors in 1 module.`

which elm-make also points to /home/sudhir/bin/elm-make

I am a little puzzled as I can see the nativeUi overrides in the Elm-Platform/0.16/elm-compiler/src/Nitpick/TopLevelTypes.hs file too

Thanks in advance

mk commented 8 years ago

@sudhirvkumar this sounds it's using the wrong elm-make. I've had cases where which elm-make would return the correct one but npm didn't. Try running

elm-make Main.elm --output elm.js

manually and if that works renaming the original elm-make.

sudhirvkumar commented 8 years ago

@mk Thanks. I moved the /usr/bin/elm-make to elm-make-orig and copied the compiled elm-make to /usr/bin and it worked!!

Thanks! :+1:

I am going to use elm for building React Native Apps. Will make progress and send PRs.