0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

Fixed dlib dependency issue

This commit is contained in:
boltgolt 2018-04-12 23:45:52 +02:00
parent fceb61a91b
commit e15ef74439
5 changed files with 29 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# Howdy for Ubuntu [![](https://travis-ci.org/Boltgolt/howdy.svg?branch=dev)](https://travis-ci.org/Boltgolt/howdy)
# Howdy for Ubuntu [![](https://travis-ci.org/Boltgolt/howdy.svg?branch=dev)](https://travis-ci.org/Boltgolt/howdy) ![](https://img.shields.io/github/release/Boltgolt/howdy.svg) [![](https://img.shields.io/github/issues-raw/Boltgolt/howdy/enhancement.svg?label=feature requests)](https://github.com/Boltgolt/howdy/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)
Windows Hello™ style authentication for Ubuntu. Use your built-in IR emitters and camera in combination with face recognition to prove who you are.

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
howdy (2.0.0-alpha+3) xenial; urgency=medium
* Fixed issue where dlib dependency failed to install on some installations
* Added preinst script for camera detection
-- boltgolt <boltgolt@gmail.com> Thu, 12 Apr 2018 21:42:42 +0000
howdy (2.0.0-alpha+2) xenial; urgency=medium
* Fixed build dependency issue

15
debian/postinst vendored
View file

@ -25,25 +25,27 @@ def handleStatus(status):
print("\033[31mError while running last command\033[0m")
sys.exit(1)
log("Upgrading pip to the latest version")
# We're not in fresh configuration mode, so exit
if not os.path.exists("/tmp/howdy_picked_device"):
sys.exit(0)
in_file = open("/tmp/howdy_picked_device", "r")
picked = int(in_file.read())
# Should be a string
picked = in_file.read()
in_file.close()
subprocess.call(["rm /tmp/howdy_picked_device"], shell=True)
log("Upgrading pip to the latest version")
# Update pip
handleStatus(subprocess.call(["pip3 install --upgrade pip"], shell=True))
log("Cloning dlib")
# Clone the git to /tmp
handleStatus(subprocess.call(["git", "clone", "https://github.com/davisking/dlib.git", "/tmp/dlib_clone"]))
handleStatus(subprocess.call(["git", "clone", "--depth", "1", "https://github.com/davisking/dlib.git", "/tmp/dlib_clone"]))
log("Building dlib")
@ -56,10 +58,15 @@ log("Cleaning up dlib")
handleStatus(subprocess.call(["rm", "-rf", "/tmp/dlib_clone"]))
print("Temporary dlib files removed")
log("Installing python dependencies")
# Install face_recognition though pip
handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "face_recognition_models==0.3.0", "Click>=6.0", "numpy", "Pillow"]))
log("Installing face_recognition")
# Install face_recognition though pip
handleStatus(subprocess.call(["pip3", "install", "face_recognition"]))
handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "--no-deps", "face_recognition==1.2.2"]))
log("Configuring howdy")

1
debian/preinst vendored Normal file → Executable file
View file

@ -86,4 +86,5 @@ if picked == -1:
with open("/tmp/howdy_picked_device", "w") as out_file:
out_file.write(str(picked))
# Add a line break
print("")

10
debian/prerm vendored
View file

@ -12,14 +12,22 @@ def col(id):
import subprocess
# Remove files and symlinks
try:
subprocess.call(["rm /usr/local/bin/howdy"], shell=True)
except e:
print("Can't remove executable")
try:
subprocess.call(["rm /usr/share/bash-completion/completions/howdy"], shell=True)
except e:
print("Can't remove autocompletion script")
try:
subprocess.call(["rm -rf /lib/security/howdy"], shell=True)
except e:
# This error is normal
pass
# Remove face_recognition and dlib
subprocess.call(["pip3 uninstall face_recognition dlib -y --no-cache-dir"], shell=True)
subprocess.call(["pip3 uninstall face_recognition face_recognition_models dlib -y --no-cache-dir"], shell=True)
# Print a tearbending message
print(col(2) + """