Skip to content

Commit

Permalink
Merge pull request #17 from futrnostr/rebuild
Browse files Browse the repository at this point in the history
Rebuild
  • Loading branch information
prolic authored Aug 12, 2024
2 parents 672758c + a1b1082 commit ecb6687
Show file tree
Hide file tree
Showing 68 changed files with 2,180 additions and 3,712 deletions.
5 changes: 0 additions & 5 deletions .ghci

This file was deleted.

3 changes: 0 additions & 3 deletions .ghcid

This file was deleted.

Empty file modified .github/workflows/ci.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/publish.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
40 changes: 0 additions & 40 deletions Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions Info.plist

This file was deleted.

692 changes: 674 additions & 18 deletions LICENSE
100644 → 100755

Large diffs are not rendered by default.

48 changes: 36 additions & 12 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,62 @@ nostr client desktop app written in haskel.

The name 'futr' was chosen from respect for the honorable Canadians.

## License

Released under GPLv3.

See [LICENSE](License File).

## For developers

### Linux

You need to have docker installed, alternatively see the Dockerfile itself for how to setup your local system.
#### GHCUp

First you need to grab the "The Haskell Tool Stack"
`sudo apt-get install build-essential`

```bash
curl -sSL https://get.haskellstack.org/ | sh
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ghcup install ghc 9.4.8
ghcup install cabal 3.12.1.0
ghcup set ghc 9.4.8
ghcup set cabal 3.12.1.0
```

Build the project (only changed files are re-compiled)
#### For QT:

Note: The very fist compilation takes a while, after that it goes fairly quick.
`sudo apt-get install qtdeclarative5-dev libqt5quick5`

```bash
./devbuild.sh
```
export LD_LIBRARY_PATH=/home/sasa/Qt/qtdesignstudio-2.3.1-community/qt5_design_studio_reduced_version/lib:$LD_LIBRARY_PATH

#### For secp256k1 (from source)

Execute the newly created binary
`sudo apt-get install autoconf autogen automake libtool`

```bash
./futr-x86_64.AppImage
```

Feel free to copy this file into any directory that is part of your $PATH (f.e. /usr/bin).
git clone https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
./autogen.sh && \
./configure --enable-module-schnorrsig --enable-module-extrakeys --enable-module-ecdh --enable-experimental --enable-module-recovery && \
make && \
make install && \
cd ..

```

### MacOS

@todo

#### Windows

```bash
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; try { Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true } catch { Write-Error $_ }
ghcup install ghc 9.4.8
ghcup install cabal 3.12.1.0
ghcup set ghc 9.4.8
ghcup set cabal 3.12.1.0
```
@todo
44 changes: 43 additions & 1 deletion Setup.hs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
import Distribution.Simple
main = defaultMain
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import System.Process
import System.Exit
import System.Directory

main :: IO ()
main = defaultMainWithHooks simpleUserHooks {
--hookedPrograms = [simpleProgram "Setup libsec256k1"],
preConf = \args flags -> do
let repoDir = "secp256k1"
repoExists <- doesDirectoryExist repoDir
unless repoExists $
callProcess "git" ["clone", "https://github.com/bitcoin-core/secp256k1.git"]

setCurrentDirectory repoDir

callProcess "./autogen.sh" []
let prefix = "../vendor/secp256k1"
callProcess "./configure"
[ "--prefix=" ++ prefix
, "--enable-module-schnorrsig"
, "--enable-module-extrakeys"
, "--enable-module-ecdh"
, "--enable-experimental"
, "--enable-module-recovery"
]

callProcess "make" []
callProcess "make" ["install"]

setCurrentDirectory ".."

let pkgConfigPath = "PKG_CONFIG_PATH"
pkgConfigValue <- lookupEnv pkgConfigPath
let newPkgConfigValue = case pkgConfigValue of
Nothing -> prefix ++ "/lib/pkgconfig"
Just val -> prefix ++ "/lib/pkgconfig:" ++ val
setEnv pkgConfigPath newPkgConfigValue

return (Nothing, [])
}
}
Binary file removed assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file removed assets/fonts/Roboto-Regular.ttf
Binary file not shown.
Binary file removed assets/icons/futr-icon.png
Binary file not shown.
Binary file removed assets/icons/keys-icon.png
Binary file not shown.
Binary file removed assets/icons/relay-icon.png
Binary file not shown.
10 changes: 8 additions & 2 deletions cabal.project
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
packages:
./

package nanovg
flags: +stb_truetype
source-repository-package
type: git
location: https://github.com/haskell-bitcoin/libsecp256k1-haskell


source-repository-package
type: git
location: https://github.com/prolic/HsQML/
84 changes: 27 additions & 57 deletions futr.cabal
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,89 +1,59 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.4.
--
-- see: https://github.com/sol/hpack

name: futr
version: 0.1.0.0
homepage: https://github.com/prolic/futr#readme
author: Sascha-Oliver Prolic
maintainer: [email protected]
copyright: 2022 Sascha-Oliver Prolic
license: MIT
copyright: 2024 Sascha-Oliver Prolic
license: LGPL-3
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md

executable futr
main-is: Main.hs
other-modules:
AppTypes
DebugJSON
Futr
Helpers
Nostr.Event
Nostr.Filter
Nostr.Keys
Nostr.Kind
Nostr.Profile
Nostr.Relay
Nostr.RelayConnection
Nostr.RelayPool
Nostr.Request
Nostr.Response
UI
UIHelpers
Widgets.BackupKeys
Widgets.EditProfile
Widgets.KeyManagement
Widgets.PostDetails
Widgets.Profile
Widgets.ProfileImage
Widgets.RelayManagement
Widgets.Setup
Widgets.ViewPosts
Paths_futr
hs-source-dirs:
src
ghc-options: -fwarn-incomplete-patterns -threaded
ghc-options: -threaded -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Werror
extra-lib-dirs:
/usr/local/lib
extra-libraries:
secp256k1
build-depends:
DRBG >=0.5.5 && <0.6
, JuicyPixels
, aeson
, base >=4.9 && <5
, base16 >=0.3.0.1
aeson
, base
, base16-bytestring
, basement
, bytestring >=0.10.8 && <0.11
, bytestring-to-vector
, connection
, bech32
, binary
, bytestring
, containers
, cryptohash-sha256
, data-default
, datetime
, directory
, filepath
, http-client
, entropy
, haskoin-core
, hsqml
, lens
, libsecp256k1
, modern-uri
, monomer
, mtl
, network
, parallel-io
, req
, secp256k1-schnorr
, random
, secp256k1-haskell
, stm
, text
, text-show
, transformers
, utf8-string
, time
, vector
, websockets
, wreq
, wuss
other-modules:
Nostr.Keys
Nostr.Kind
Nostr.Profile
Nostr.Relay
Paths_futr
data-dir:
resources
data-files:
config.yaml qml/**/*.qml qml/qmlmodules qml/content/qmldir
default-language: Haskell2010

57 changes: 0 additions & 57 deletions package.yaml

This file was deleted.

Loading

0 comments on commit ecb6687

Please sign in to comment.